Logo
(追記) (追記ここまで)

11772번 - POT 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 64 MB13421136107585.794%

문제

The teacher has sent an e-mail to her students with the following task:

"Write a programme that will determine and output the value of \(X\) if given the statement:

\[X = number_1^{pot_1} + number_2^{pot_2} + \dots + number_N^{pot_N}\]

and it holds that \(number_1\), \(number_2\) to \(number_N\) are integers, and \(pot_1\), \(pot_2\) to \(pot_N\) one-digit integers." Unfortunately, when the teacher downloaded the task to her computer, the text formatting was lost so the task transformed into a sum of \(N\) integers:

\[X = P_1 + P_2 + ... + P_N\]

For example, without text formatting, the original task in the form of \(X = 21^2 + 125^3\) became a task in the form of \(X = 212 + 1253\). Help the teacher by writing a programme that will, for given \(N\) integers from \(P_1\) to \(P_N\) determine and output the value of \(X\) from the original task.

Please note: We know that it holds a \(N = a \cdot a \cdot \dots \cdot a\) (\(N\) times).

입력

The first line of input contains the integer \(N\) (1 ≤ \(N\) ≤ 10), the number of the addends from the task. Each of the following \(N\) lines contains the integer \(P_i\) (10 ≤ \(P_i\) ≤ 9999, \(i\) = 1 ... \(N\)) from the task.

출력

The first and only line of output must contain the value of \(X\) (\(X\) ≤ 1 000 000 000) from the original task.

제한

예제 입력 1

2
212
1253

예제 출력 1

1953566

예제 입력 2

5
23
17
43
52
22

예제 출력 2

102

예제 입력 3

3
213
102
45

예제 출력 3

10385

힌트

Clarification of the first example: 212 + 1253 = 441 +たす 1953125 = 1953566.

출처

Contest > Croatian Open Competition in Informatics > COCI 2015/2016 > Contest #3 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /