# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
837157 |
2023-08-25T05:12:31 Z |
12345678 |
Labels (NOI20_labels) |
C++17 |
|
39 ms |
5876 KB |
#include <bits/stdc++.h>
using namespace std;
const int nx=3e5+5;
int n, d[nx], dp[nx], mn, mx, ans[nx];
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
for (int i=2; i<=n; i++) cin>>d[i], dp[i]=dp[i-1]+d[i], mn=min(mn, dp[i]), mx=max(mx, dp[i]);
if (mx-mn<n-1)
{
cout<<-1;
return 0;
}
for (int i=1; i<=n; i++) cout<<dp[i]+mn+1<<' ';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
5196 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
39 ms |
5876 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |