蒟蒻求调 全WA
查看原帖
蒟蒻求调 全WA
1115904
malinhao45楼主2023/12/31 23:06
#include <iostream>
#include <string>
#include<algorithm>
using namespace std;
int a[1000000];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
int n;
cin>>n;
int m;
cin>>m;
for(int i=0;i<m;i++){
	cin>>a[i];
}
sort(a+0,a+n);
int cnt=n;
int j=0;
bool cmp=true;
for(int i=0;i<n;i++){
	if(a[j]==i){
		while(a[j]==i&&j<=m){
			j++;
		}
	}else{
		cnt=i;
		cout<<cnt<<" ";
		cmp=false;
	}
}
if(cmp==true){
cout<<n;	
}
	return 0;
}
2023/12/31 23:06
加载中...