#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
vector<int> v;
int p = 0;
for (int i = 1; i <= n; i++){
int a; cin >> a;
a = a + p;
v.push_back(a%10);
p = a/10;
}
v.push_back(p);
int x = 0;
for (int i = n-1; i >= 0; i--){
if (v[i] != 0){
x = i;
break;
}
}
cout << (to_string(v[x]))+string(n-1, '0');
/*
//reverse(v.begin(), v.end());
int mego = v[n-1]; // lehet 0
for (int i = n-2; i >= 0; i--){
//cout << n-i-1 << " " << v[i]/10 << endl;
if (v[i] / 10 >= n-i-1){
mego += v[i]/10;
break;
}
}
cout << (to_string(mego))+string(n-1, '0');
*/
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1812 KiB | ||||
2 | Accepted | 3ms | 2052 KiB | ||||
3 | Accepted | 2ms | 2144 KiB | ||||
subtask2 | 0/25 | ||||||
4 | Wrong answer | 2ms | 2088 KiB | ||||
5 | Wrong answer | 3ms | 2212 KiB | ||||
6 | Wrong answer | 2ms | 2288 KiB | ||||
7 | Wrong answer | 2ms | 2300 KiB | ||||
8 | Wrong answer | 3ms | 2316 KiB | ||||
subtask3 | 0/26 | ||||||
9 | Wrong answer | 3ms | 2424 KiB | ||||
10 | Wrong answer | 3ms | 2640 KiB | ||||
11 | Wrong answer | 3ms | 2848 KiB | ||||
12 | Wrong answer | 2ms | 2936 KiB | ||||
13 | Wrong answer | 2ms | 2932 KiB | ||||
14 | Accepted | 2ms | 2972 KiB | ||||
15 | Wrong answer | 3ms | 3092 KiB | ||||
16 | Wrong answer | 3ms | 3304 KiB | ||||
subtask4 | 0/19 | ||||||
17 | Wrong answer | 3ms | 3292 KiB | ||||
18 | Wrong answer | 2ms | 3292 KiB | ||||
19 | Wrong answer | 2ms | 3288 KiB | ||||
20 | Wrong answer | 3ms | 3292 KiB | ||||
subtask5 | 0/30 | ||||||
21 | Wrong answer | 4ms | 4512 KiB | ||||
22 | Wrong answer | 4ms | 4524 KiB | ||||
23 | Wrong answer | 4ms | 4448 KiB | ||||
24 | Wrong answer | 4ms | 4384 KiB | ||||
25 | Wrong answer | 4ms | 4384 KiB | ||||
26 | Wrong answer | 4ms | 4508 KiB | ||||
27 | Wrong answer | 4ms | 4488 KiB | ||||
28 | Wrong answer | 3ms | 3356 KiB |