Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
230114 | 顾欣薇 | 出操 | C++ | 运行超时 | 0 | 1000 MS | 6188 KB | 400 | 2024-01-07 16:12:05 |
#include <bits/stdc++.h> using namespace std; int n,m,t; stack<int>a; bool b[1000006]={0}; int main() { cin >>n >> m; for (int i=1;i<=m;i++) { cin >> t; a.push(t); } for (int i=1;!a.empty();i++) { if (b[a.top()]==0) { cout << a.top() << ' '; b[a.top()]=1; a.pop(); } } for (int i=1;i<=n;i++) { if (b[i]==0) { cout << i << ' '; } } return 0; }