P27873 [洛谷] Spring Outing
普及
题目描述

Problem Description

A teacher is leading a class on a spring outing. There are \( N \) students in the class, each with a unique ID ranging from \( 0 \) to \( N-1 \). At the gathering time, the teacher checks if all students have arrived at the meeting point by having them report their IDs. Each student who arrives will report their own ID, not someone else's, but some students may be mischievous and report multiple times. Can you help the teacher identify which students have not arrived?

Input Format

The input consists of 2 lines. The first line contains two integers \( N \) and \( M \), indicating that there are \( N \) students in the class and \( M \) reports of IDs. It is guaranteed that \( 2 \le N, M \le 1000 \).
The second line contains \( M \) integers, representing the \( M \) reported IDs. All reported IDs are non-negative integers less than \( N \).

Output Format

Output a single line. If all students have arrived, output \( N \); otherwise, output the IDs of the students who have not arrived in ascending order, separated by spaces.

Sample Input and Output

Sample Input #1

3 3
0 2 1

Sample Output #1

3

Sample Input #2

3 5
0 0 0 0 0

Sample Output #2

1 2
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 3 0 2 1
样例输出
3