Submission #284551

#TimeUsernameProblemLanguageResultExecution timeMemory
284551kshitij_sodaniLabels (NOI20_labels)C++14
100 / 100
67 ms6904 KiB
//#pragma GCC optimize("Ofast,unroll-loops") //#pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; typedef long long llo; #define mp make_pair #define pb push_back #define a first #define b second //#define endl '\n' llo n; llo it[300001]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n; llo mi=0; llo ma=0; for(llo i=1;i<n;i++){ llo aa; cin>>aa; it[i]=it[i-1]+aa; mi=min(mi,it[i]); ma=max(ma,it[i]); } if(ma-mi!=n-1){ cout<<-1<<endl; } else{ for(llo i=0;i<n;i++){ cout<<it[i]-mi+1<<" "; } cout<<endl; } return 0; }
#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...