답안 #320517

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
320517 2020-11-09T02:57:17 Z strawberry2005 Labels (NOI20_labels) C++14
25 / 100
52 ms 3684 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;
        }
    }
    if(status==0) cout<<"-1";
    else{
        
        if(sum==n*-1+1){
            int l=n;
            cout<<n<<" ";
            for(int i=0;i<n-1;i++){
                cout<<l+f[i]<<" ";
                l+=f[i];
            }
        }
        else{
            int l=1;
            cout<<"1 ";
            for(int i=0;i<n-1;i++){
                cout<<l+f[i]<<" ";
                l+=f[i];
            }
        }
    }


    return(0);
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 3512 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 52 ms 3684 KB Output is correct
4 Correct 19 ms 1516 KB Output is correct
5 Correct 23 ms 1516 KB Output is correct
6 Correct 23 ms 1516 KB Output is correct
7 Correct 22 ms 1508 KB Output is correct
8 Correct 23 ms 1516 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 0 ms 364 KB Output is correct
# 결과 실행 시간 메모리 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 -