97482024-03-06 11:23:05UnluckYDecimáliacpp17Wrong answer 25/1004ms5756 KiB
#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;
    }
    while (p > 0){
        v.push_back(p%10);
        p /= 10;
    }
    


    int x = 0;
    for (int i = v.size()-1; i >= 0; i--){
        if (v[i] != 0){
            x = i;
            break;
        }
    }

    cout << (to_string(v[x]))+string(x, '0') << endl;




/*
    //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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1684 KiB
2Accepted3ms1988 KiB
3Accepted3ms2128 KiB
subtask225/25
4Accepted3ms2280 KiB
5Accepted3ms2520 KiB
6Accepted3ms2636 KiB
7Accepted3ms2764 KiB
8Accepted3ms2952 KiB
subtask30/26
9Accepted3ms3172 KiB
10Accepted3ms3256 KiB
11Accepted3ms3388 KiB
12Accepted3ms3636 KiB
13Wrong answer2ms3728 KiB
14Accepted3ms3796 KiB
15Accepted3ms3928 KiB
16Accepted3ms3904 KiB
subtask40/19
17Wrong answer3ms4116 KiB
18Wrong answer3ms4220 KiB
19Wrong answer3ms4208 KiB
20Wrong answer3ms4140 KiB
subtask50/30
21Wrong answer4ms5368 KiB
22Wrong answer4ms5528 KiB
23Wrong answer4ms5480 KiB
24Wrong answer4ms5324 KiB
25Wrong answer4ms5344 KiB
26Wrong answer4ms5544 KiB
27Wrong answer4ms5756 KiB
28Wrong answer3ms4688 KiB