Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
230063 | 陆沛埦 | 出操 | C++ | 解答错误 | 0 | 212 MS | 3480 KB | 464 | 2024-01-07 15:25:51 |
#include<bits/stdc++.h> using namespace std; queue<int>q; bool vis[1000002]; int n,m; int main() { scanf("%d%d",&n,&m); for(int i=1; i<=n; i++) vis[i]=false; for(int i=1; i<=m; i++) { int t; scanf("%d",&t); if(vis[t]==false) { q.push(t); vis[t]=true; } } while(!q.empty()) { int u=q.front(); q.pop(); printf("%d ",u); } for(int i=1; i<=n; i++) { if(vis[i]==false) printf("%d ",i); } return 0; }