# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
892956 | votranngocvy | Labels (NOI20_labels) | C++14 | 45 ms | 5972 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;
const int N = 3e5 + 5;
int a[N];
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
int Min = 0,Max = 0;
bool ok = true;
for (int i = 2; i <= n; i++) {
cin >> a[i];
a[i] += a[i - 1];
Min = min(Min,a[i]);
Max = max(Max,a[i]);
}
Min = abs(Min) + 1;
if (Min + Max < n) {
cout << -1 << "\n";
return 0;
}
for (int i = 1; i <= n; i++) cout << Min + a[i] << " ";
cout << "\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... |