# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
600280 |
2022-07-20T16:14:35 Z |
Codula |
Labels (NOI20_labels) |
C++17 |
|
115 ms |
21424 KB |
//IOI 2023 I am coming.
#include "bits/stdc++.h"
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define int int64_t
#define pb push_back
int32_t main(){
fast;
int n;
cin>>n;
vector<int>a(n);
a[0]=0;
int dy=0;
for(int i=1;i<n;++i){
int dx;
cin>>dx;
a[i]=a[i-1]+dx;
dy=max(dy,a[i]);
}
map<int,int>mp;
int dx=n-dy;
int ans=1;
//~ cerr<<dx<<"\n";
for(int i=0;i<n;++i){
ans&=(mp[a[i]]==0&&(a[i]!=0));
mp[a[i]]++;
a[i]+=dx;
}
if(ans==0){
cout<<"-1\n";
}
else{
for(auto i:a)cout<<i<<" ";
cout<<"\n";
}
return 0;
}
//1 4 3 2 5 6
/*
* 3 -1 -1 -3 -1
*
*
*
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
115 ms |
21424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |