Submission #600281

# Submission time Handle Problem Language Result Execution time Memory
600281 2022-07-20T16:15:57 Z Codula Labels (NOI20_labels) C++17
25 / 100
146 ms 23444 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]+dx)!=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 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 141 ms 23444 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 146 ms 23356 KB Output is correct
4 Correct 13 ms 2644 KB Output is correct
5 Correct 27 ms 2672 KB Output is correct
6 Correct 94 ms 11964 KB Output is correct
7 Correct 96 ms 12036 KB Output is correct
8 Correct 26 ms 2644 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -