题目链接:AIZU1367
签到题,简单模拟
AC代码:
/*
2017年8月10日09:43:40
签到题
AC
*/
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=2e6+10;
struct node{
int x,y;
/*bool operator <(const node &B) {
return y>B.y;
}
*/
}a[maxn];
bool cmp(const node &A,const node &B){
return A.y>B.y;
}
int main(){
int n,m;
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++){
a[i].x=i;a[i].y=-i;
}
for(int i=1;i<=m;i++){
int x;
scanf("%d",&x);
a[x].y=i;
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
printf("%d\n",a[i].x);
}
return 0;
}