# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
872897 |
2023-11-14T04:30:52 Z |
vjudge1 |
Labels (NOI20_labels) |
C++11 |
|
65 ms |
5768 KB |
#include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> D(N - 1);
for (int i = 0; i < N - 1; i++) {
cin >> D[i];
}
vector<int> A(N);
A[0] = 1;
for (int i = 1; i < N; i++) {
A[i] = A[i - 1] + D[i - 1];
}
bool valid = true;
for (int i = 0; i < N - 1; i++) {
if (A[i] + D[i] != A[i + 1]) {
valid = false;
break;
}
}
if (valid) {
for (int i = 0; i < N; i++) {
cout << A[i] << " ";
}
cout << endl;
} else {
cout << -1 << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
5040 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
65 ms |
5768 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |