11.26
include
include<unordered_set>
include
using namespace std;
int main(){
int N;
cin>>N;
if(N<1||N>100000){
cout<<"error"<<endl;
return 0;
}
vector
for(int i=0;i<N;++i){
cin>>A[i];
if(A[i]<1||A[i]>100000){
cout<<"error"<<endl;
return 0;
}
}
unordered_set
seen.insert(A[0]);
for(int i=1;i<N;++i){
int current=A[i];
while(seen.count(current)){
current++;
}
A[i]=current;
seen.insert(current);
}
for(int i=0;i<N;++i){
if(i>0)cout<<"";
cout<<A[i]<<" ";
}
cout<<endl;
return 0;
}

浙公网安备 33010602011771号