# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
261327 | Nightlight | Labels (NOI20_labels) | C++14 | 122 ms | 5568 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 N;
int A[300005], mx, mn, D;
int main() {
scanf("%d", &N);
A[1] = mx = mn = 1;
for(int i = 2; i <= N; i++) {
scanf("%d", &D);
A[i] = A[i - 1] + D;
mx = max(mx, A[i]);
mn = min(mn, A[i]);
}
if(mx - mn == N - 1) {
for(int i = 1; i <= N; i++) {
printf("%d ", A[i] + (1 - mn));
}
}else puts("-1");
cin >> N;
}
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... |