97472024-03-06 11:20:41UnluckYDecimáliacpp17Wrong answer 0/1004ms5276 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 = 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1852 KiB
2Accepted3ms2004 KiB
3Accepted3ms2360 KiB
subtask20/25
4Wrong answer3ms2392 KiB
5Wrong answer3ms2528 KiB
6Wrong answer3ms2740 KiB
7Wrong answer3ms2884 KiB
8Wrong answer3ms3064 KiB
subtask30/26
9Wrong answer3ms3188 KiB
10Wrong answer3ms3340 KiB
11Wrong answer3ms3344 KiB
12Wrong answer3ms3468 KiB
13Wrong answer3ms3600 KiB
14Accepted3ms3540 KiB
15Wrong answer3ms3544 KiB
16Wrong answer3ms3540 KiB
subtask40/19
17Wrong answer3ms3668 KiB
18Wrong answer3ms3548 KiB
19Wrong answer3ms3560 KiB
20Wrong answer3ms3552 KiB
subtask50/30
21Wrong answer4ms4816 KiB
22Wrong answer4ms4824 KiB
23Wrong answer4ms4784 KiB
24Wrong answer4ms5064 KiB
25Wrong answer4ms5276 KiB
26Wrong answer4ms5124 KiB
27Wrong answer4ms5132 KiB
28Wrong answer3ms4116 KiB