Submission #284859

#TimeUsernameProblemLanguageResultExecution timeMemory
284859lukameladzeLabels (NOI20_labels)C++14
100 / 100
251 ms7932 KiB
# include <bits/stdc++.h> using namespace std; long long b[1000005], n,a[1000005],mn,mx; int main() { cin>>n; b[1]=0; for (int i=2; i<=n; i++) { cin>>a[i]; b[i]=b[i-1]+a[i]; mx=max(mx,b[i]); mn=min(mn,b[i]); } if (mx-mn<n-1) { cout<<"-1"<<endl; return 0; } for (int i=1; i<=n; i++) { cout<<b[i]+(1-mn)<<" "; } cout<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...