Submission #284831

#TimeUsernameProblemLanguageResultExecution timeMemory
284831keta_tsimakuridzeLabels (NOI20_labels)C++14
100 / 100
244 ms5624 KiB
#include<bits/stdc++.h> using namespace std; int n,mn,mx,a[300005],k,b; int main(){ cin>>n; a[1]=0;mn=mx=0; for(k=1;k<n;k++){ cin>>b; a[k+1]=a[k]+b; mn=min(mn,a[k+1]); mx=max(mx,a[k+1]); } if(mx+1-mn<n)cout<<-1; else { for(k=1;k<=n;k++){ cout<<a[k]+(1-mn)<<" "; } } }
#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...