Submission #320524

# Submission time Handle Problem Language Result Execution time Memory
320524 2020-11-09T03:31:22 Z strawberry2005 Labels (NOI20_labels) C++14
25 / 100
55 ms 4708 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);
    long long n;
    cin>>n;
    long long f[n-1];
    for(int i=0;i<n-1;i++) cin>>f[i];
    long long sum=0,status=0;
    for(int i=0;i<n-1;i++){
        sum+=f[i];
        if(abs(sum)==n-1){
            status=1;
            break;
        }
    }
    if(status==0) cout<<"-1";
    else{
        
        if(sum==n*-1+1){
            long long l=n;
            cout<<n<<" ";
            for(int i=0;i<n-1;i++){
                cout<<l+f[i]<<" ";
                l+=f[i];
            }
        }
        else{
            long long l=1;
            cout<<"1 ";
            for(int i=0;i<n-1;i++){
                cout<<l+f[i]<<" ";
                l+=f[i];
            }
        }
    }


    return(0);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Incorrect 0 ms 364 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Incorrect 0 ms 364 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 55 ms 4708 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 50 ms 4708 KB Output is correct
4 Correct 20 ms 2668 KB Output is correct
5 Correct 23 ms 2924 KB Output is correct
6 Correct 30 ms 2660 KB Output is correct
7 Correct 22 ms 2668 KB Output is correct
8 Correct 24 ms 2660 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
5 Incorrect 0 ms 364 KB Output isn't correct
6 Halted 0 ms 0 KB -