Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
230075 陆沛埦 出操 C++ 输出超限 40 180 MS 2260 KB 471 2024-01-07 15:34:57

Tests(2/5):


#include<bits/stdc++.h> using namespace std; stack<char>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(t<=n) q.push(t); } while(!q.empty()) { int u=q.top(); q.pop(); if(vis[u]!=true) { printf("%d ",u); vis[u]=true; } } for(int i=1; i<=n; i++) { if(vis[i]==false) printf("%d ",i); } return 0; }


测评信息: