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))
break
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 | 18ms | 11248 KiB | ||||
2 | Wrong answer | 17ms | 11500 KiB | ||||
3 | Accepted | 17ms | 11716 KiB | ||||
subtask2 | 0/25 | ||||||
4 | Accepted | 17ms | 12040 KiB | ||||
5 | Wrong answer | 17ms | 11872 KiB | ||||
6 | Wrong answer | 17ms | 12352 KiB | ||||
7 | Wrong answer | 17ms | 12552 KiB | ||||
8 | Wrong answer | 17ms | 12720 KiB | ||||
subtask3 | 0/26 | ||||||
9 | Wrong answer | 17ms | 12664 KiB | ||||
10 | Wrong answer | 17ms | 12772 KiB | ||||
11 | Wrong answer | 17ms | 13224 KiB | ||||
12 | Wrong answer | 17ms | 13312 KiB | ||||
13 | Wrong answer | 17ms | 13264 KiB | ||||
14 | Accepted | 16ms | 12972 KiB | ||||
15 | Wrong answer | 17ms | 13152 KiB | ||||
16 | Wrong answer | 17ms | 13152 KiB | ||||
subtask4 | 0/19 | ||||||
17 | Wrong answer | 17ms | 13320 KiB | ||||
18 | Wrong answer | 17ms | 13560 KiB | ||||
19 | Wrong answer | 17ms | 13280 KiB | ||||
20 | Wrong answer | 17ms | 13780 KiB | ||||
subtask5 | 0/30 | ||||||
21 | Wrong answer | 273ms | 40212 KiB | ||||
22 | Wrong answer | 273ms | 40340 KiB | ||||
23 | Wrong answer | 275ms | 40332 KiB | ||||
24 | Wrong answer | 277ms | 40240 KiB | ||||
25 | Wrong answer | 275ms | 40340 KiB | ||||
26 | Wrong answer | 270ms | 40332 KiB | ||||
27 | Wrong answer | 165ms | 29312 KiB | ||||
28 | Wrong answer | 17ms | 13808 KiB |