# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
522441 |
2022-02-05T03:48:11 Z |
darrryl |
Labels (NOI20_labels) |
C++14 |
|
40 ms |
7504 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,a,b) for (int i = a; i < b; ++i)
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int d[n-1];
REP(i,0,n-1) {
cin >> d[i];
}
int a[n] = {};
a[0] = 1;
REP(i,1,n) {
a[i] = a[i-1] + d[i-1];
}
if (*max_element(a,a+n) == n) {
REP(i,0,n) {
cout << a[i] << ' ';
}
}
else {
cout << -1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
40 ms |
7504 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
19 ms |
5816 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |