97462024-03-06 11:16:00UnluckYDecimáliacpp17Wrong answer 0/1004ms4524 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;
    }
    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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1812 KiB
2Accepted3ms2052 KiB
3Accepted2ms2144 KiB
subtask20/25
4Wrong answer2ms2088 KiB
5Wrong answer3ms2212 KiB
6Wrong answer2ms2288 KiB
7Wrong answer2ms2300 KiB
8Wrong answer3ms2316 KiB
subtask30/26
9Wrong answer3ms2424 KiB
10Wrong answer3ms2640 KiB
11Wrong answer3ms2848 KiB
12Wrong answer2ms2936 KiB
13Wrong answer2ms2932 KiB
14Accepted2ms2972 KiB
15Wrong answer3ms3092 KiB
16Wrong answer3ms3304 KiB
subtask40/19
17Wrong answer3ms3292 KiB
18Wrong answer2ms3292 KiB
19Wrong answer2ms3288 KiB
20Wrong answer3ms3292 KiB
subtask50/30
21Wrong answer4ms4512 KiB
22Wrong answer4ms4524 KiB
23Wrong answer4ms4448 KiB
24Wrong answer4ms4384 KiB
25Wrong answer4ms4384 KiB
26Wrong answer4ms4508 KiB
27Wrong answer4ms4488 KiB
28Wrong answer3ms3356 KiB