11.24

include

include<unordered_set>

include

using namespace std;
int main(){
int N;
cin>>N;
if(N<1||N>100000){
cout<<"error"<<endl;
return 0;
}
vectorA(N);
for(int i=0;i<N;++i){
cin>>A[i];
if(A[i]<1||A[i]>100000){
cout<<"error"<<endl;
return 0;
}
}
unordered_setseen;
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;
}

posted @ 2025-11-24 17:13  Cx330。  阅读(2)  评论(0)    收藏  举报