Submission #1312905

#TimeUsernameProblemLanguageResultExecution timeMemory
1312905namhhLabels (NOI20_labels)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define fi first #define se second const int N = 3e5+5; int n,ans[N],d[N],pre[N]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; for(int i = 2; i <= n; i++){ cin >> d[i]; pre[i] = pre[i-1]+d[i]; } int mn = 1e18; int mx = -1e18; for(int i = 1; i <= n; i++){ mn = min(mn,pre[i]); mx = max(mx,pre[i]); } if(mx-mn == n-1){ for(int i = 1; i <= n; i++) cout << pre[i]+n-mx << " "; return 0; } cout << -1; }

Compilation message (stderr)

cc1plus: error: '::main' must return 'int'