# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
522450 |
2022-02-05T04:11:22 Z |
darrryl |
Labels (NOI20_labels) |
C++14 |
|
47 ms |
7372 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) - *min_element(a,a+n) == n - 1) {
REP(i,0,n) {
cout << a[i] << ' ';
}
}
else {
cout << -1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
7048 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
42 ms |
7372 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |