You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
534 B

1 year ago
#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int b[N]; // 1、定义桶
/*
3 3
0 2 1
*/
int main() {
// 2、处理输入输出
int n, m;
cin >> n >> m; // n:有n个同学m:报了m次数
while (m--) {
int x;
cin >> x;
b[x] = 1;
}
bool flag = false;
for (int i = 0; i < n; i++)
if (!b[i]) {
flag = true;
cout << i << " ";
}
if (!flag) {
cout << n << endl;
}
return 0;
}