# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1076763 |
2024-08-26T16:19:50 Z |
sqrteipi |
Labels (NOI20_labels) |
C++14 |
|
27 ms |
5928 KB |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define i128 __int128
#define ff first
#define ss second
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vector<int>>
#define REP1(a) for (int _ = 0; _ < a; ++_)
#define REP2(i, a) for (int i = 0; i < a; ++i)
#define REP3(i, a, b) for (int i = a; i < b; ++i)
#define REP4(i, a, b, c) for (int i = a; i < b; i += c)
#define overload4(a, b, c, d, e, ...) e
#define REP(...) overload4(__VA_ARGS__, REP4, REP3, REP2, REP1)(__VA_ARGS__)
#define pb push_back
#define fast_io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T> using max_heap = priority_queue<T>;
const int MOD = 1e9+7;
const int INF = 1e18;
int32_t main(){
fast_io;
int n;
cin >> n;
int a[n-1];
REP(i, n-1) cin >> a[i];
int sum = 0, mn = 0, mx = 0;
REP(i, n-1) sum += a[i], mn = min(mn, sum), mx = max(mx, sum);
if (mx - mn != n - 1) cout << -1;
else {
int k = n - (mx - mn);
cout << k << " ";
REP(i, n-1) k += a[i], cout << k << " ";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
25 ms |
5236 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Incorrect |
27 ms |
5928 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |