Submission #837158

# Submission time Handle Problem Language Result Execution time Memory
837158 2023-08-25T05:13:56 Z 12345678 Labels (NOI20_labels) C++17
0 / 100
30 ms 7404 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=3e5+5;
long long 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 0 ms 340 KB Output is correct
2 Incorrect 0 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 0 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 0 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 6996 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 30 ms 7404 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Incorrect 0 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -