This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#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;