# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
284837 | 3zp | Labels (NOI20_labels) | C++14 | 231 ms | 3580 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int a[300009];
main(){
int n;
cin >> n;
int mn= 0, mx = 0;
for(int i = 2; i <= n; i++){
int x;
cin>>x;
a[i] = a[i-1] + x;
mn = min(mn, a[i]);
mx = max(mx, a[i]);
}
if(mx - mn != n - 1){
cout << -1<<endl;
return 0;
}
for(int i = 1; i <= n; i++){
cout<<a[i] - mn + 1 <<" ";
}
cout<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |