import math
N = int(input())
L = list(map(int, input().split()))[::-1]
osszeg = 0
for i, ertek in enumerate(L):
if math.floor(ertek / 10**i) *10**i *(10**(N-i-1)) > osszeg:
osszeg = math.floor(ertek / 10**i) *10**i *(10**(N-i-1))
continue
if math.floor(ertek / 10**i) > 0:
osszeg += math.floor(ertek / 10**i) *10**i *(10**(N-i-1))
print(osszeg)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 11232 KiB | ||||
2 | Accepted | 17ms | 11504 KiB | ||||
3 | Accepted | 17ms | 11900 KiB | ||||
subtask2 | 0/25 | ||||||
4 | Accepted | 17ms | 11976 KiB | ||||
5 | Wrong answer | 17ms | 12156 KiB | ||||
6 | Wrong answer | 17ms | 12500 KiB | ||||
7 | Wrong answer | 17ms | 12676 KiB | ||||
8 | Wrong answer | 17ms | 12836 KiB | ||||
subtask3 | 0/26 | ||||||
9 | Wrong answer | 17ms | 12708 KiB | ||||
10 | Wrong answer | 17ms | 12808 KiB | ||||
11 | Wrong answer | 17ms | 13368 KiB | ||||
12 | Wrong answer | 17ms | 13288 KiB | ||||
13 | Wrong answer | 17ms | 13112 KiB | ||||
14 | Accepted | 17ms | 13204 KiB | ||||
15 | Wrong answer | 17ms | 13028 KiB | ||||
16 | Wrong answer | 17ms | 13004 KiB | ||||
subtask4 | 0/19 | ||||||
17 | Wrong answer | 26ms | 13352 KiB | ||||
18 | Wrong answer | 24ms | 13396 KiB | ||||
19 | Wrong answer | 23ms | 13728 KiB | ||||
20 | Wrong answer | 26ms | 13572 KiB | ||||
subtask5 | 0/30 | ||||||
21 | Time limit exceeded | 570ms | 19380 KiB | ||||
22 | Time limit exceeded | 566ms | 19544 KiB | ||||
23 | Time limit exceeded | 579ms | 19532 KiB | ||||
24 | Time limit exceeded | 547ms | 19472 KiB | ||||
25 | Time limit exceeded | 564ms | 19808 KiB | ||||
26 | Time limit exceeded | 587ms | 19964 KiB | ||||
27 | Time limit exceeded | 575ms | 14292 KiB | ||||
28 | Wrong answer | 17ms | 13564 KiB |