Submission #896368

#TimeUsernameProblemLanguageResultExecution timeMemory
896368PenguinsAreCuteLabels (NOI20_labels)C++17
100 / 100
109 ms5660 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int D[N], mx = 0, mn = 0; D[0] = 0; for(int i = 1; i < N; i++) { cin >> D[i]; D[i] += D[i - 1]; mx = max(mx, D[i]); mn = min(mn, D[i]); } if(mx - mn == N - 1) { for(int i = 0; i < N; i++) { cout << D[i] + 1 - mn << " "; } } else cout << -1; }
#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...