用了bitset,不知道哪里错了,一直WA,但是测试样例是对的,大家可以给点别的样例让我测试吗。
#include <bits/stdc++.h>
using namespace std;
uint16_t N, M, t;
int main(){
cin >> N >> M;
bitset<1000> a;
for(int i=0;i<N;i++){
a.set(i);
}
for(int i=0;i<M;i++){
cin >> t;
a.reset(t);
}
if(a.none()){
cout << M;
}
else{
for(int i=0;i<N;i++){
if(a.test(i)){
cout << i << ' ';
}
}
}
return 0;
}