제출 #1182345

#제출 시각아이디문제언어결과실행 시간메모리
1182345alikhanzLabels (NOI20_labels)C++20
0 / 100
24 ms5240 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; ll max(ll x, ll y) { return x > y ? x : y; } ll min(ll x, ll y) { return x < y ? x : y; } ll gcd(ll x, ll y) { if (y == 0) return x; return gcd(y, x % y); } ll lcm(ll x, ll y) { return x * y / gcd(x, y); } #define f(i, m, n) for (ll i = (ll)m; i < (ll)n; i++) #define f_(i, n, m) for (ll i = (ll)n; i >= (ll)m; i--) #define fa(i, x) for (auto i : x) #define vll vector<ll> #define vvll vector<vll> #define vvvll vector<vvll> #define vb vector<bool> #define vvb vector<vb> #define pll pair<ll, ll> #define ff first #define ss second #define vpll vector<pll> #define all(x) x.begin(), x.end() #define vvpll vector<vpll> #define um unordered_map #define us unordered_set #define ms multiset #define pqllMaxHeap priority_queue<ll> #define pqllMinHeap priority_queue<ll, vector<ll>, greater<ll>> #define pqpll priority_queue<pll, vector<pll>, greater<pll>> #define pq(x) priority_queue<x, vector<x>, greater<x>> #define ub upper_bound #define lb lower_bound #define pb push_back #define acc accumulate #define in insert #define clr clear #define nl cout << "\n"; const ll M = 1e9 + 7; const ll M1 = 998244353; const ll inf = 1e18 + 10; const ll inf_ = -1e18 - 10; const int N = 300005; void solve() { ll n; cin >> n; vll v; v.push_back(1); ll cnt = 1; for(ll i = 0; i < n - 1; i++){ ll a; cin >> a; cnt += a; if (i == 0 && a == 0){ cout << -1 << endl; return; } v.push_back(cnt); } f(i, 0, n) cout << v[i] << " "; cout << endl; } bool multi = 0; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; if (multi) cin >> t; while (t--) solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...