| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1300109 | BuzzyBeez | Labels (NOI20_labels) | C++20 | 34 ms | 5948 KiB |
#include <bits/stdc++.h>
using namespace std;
int d[300008]; long long a[300008];
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin >> n;
for (int i = 2; i <= n; ++i) cin >> d[i];
for (int i = 2; i <= n; ++i) a[i] = a[i - 1] + d[i];
long long C = *min_element(a + 1, a + n + 1) - 1;
for (int i = 1; i <= n; ++i) a[i] -= C;
long long mx = *max_element(a + 1, a + n + 1);
if (mx != n) cout << -1;
else {for (int i = 1; i <= n; ++i) cout << a[i] << ' ';}
}| # | 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... | ||||
