Submission #320516

# Submission time Handle Problem Language Result Execution time Memory
320516 2020-11-09T02:46:03 Z strawberry2005 Labels (NOI20_labels) C++14
0 / 100
53 ms 3812 KB
#include<bits/stdc++.h>
#define deb(x) cout << #x << ": " << x << endl
using namespace std;


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int f[n-1];
    for(int i=0;i<n-1;i++) cin>>f[i];
    int sum=0,status=0;
    for(int i=0;i<n-1;i++){
        sum+=f[i];
        if(abs(sum)==n-1){
            status=1;
            break;
        }
    }
    sum=1;
    if(status==0) cout<<"-1";
    else{
        cout<<"1 ";
        
        for(int i=0;i<n-1;i++){
            cout<<sum+f[i]<<" ";
            sum+=f[i];
        }
    }


    return(0);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 3556 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 53 ms 3812 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -