| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1323378 | kawhiet | Labels (NOI20_labels) | C++20 | 1096 ms | 3900 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> d(n - 1);
for (int i = 0; i < n - 1; i++) {
cin >> d[i];
}
vector<int> ans;
for (int i = 1; i <= n; i++) {
vector<int> a(n);
a[0] = i;
for (int j = 1; j < n; j++) {
a[j] = a[j - 1] + d[j - 1];
}
if (ranges::max(a) <= n && ranges::min(a) >= 1) {
if (!ans.empty()) {
cout << -1 << '\n';
return 0;
}
ans = a;
}
}
for (int i = 0; i < n; i++) {
cout << ans[i] << ' ';
}
cout << '\n';
return 0;
}| # | 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... | ||||
