Codeforces Round 435 (Div. 2)
A
Mahmoud and Ehab and the MEX
Codeforces
1000
原题
←B →
翻译中…

Dr. Evil kidnapped Mahmoud and Ehab in the evil land because of their performance in the Evil Olympiad in Informatics (EOI). He decided to give them some problems to let them go.

翻译中…

Dr. Evil is interested in sets, He has a set of $*n*$ integers. Dr. Evil calls a set of integers evil if the MEX of it is exactly $*x*$. the MEX of a set of integers is the minimum non-negative integer that doesn't exist in it. For example, the MEX of the set ${0, 2, 4}$ is $1$ and the MEX of the set ${1, 2, 3}$ is $0$ .

翻译中…

Dr. Evil is going to make his set evil. To do this he can perform some operations. During each operation he can add some non-negative integer to his set or erase some element from it. What is the minimal number of operations Dr. Evil has to perform to make his set evil?

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*x*$ ($1 ≤ *n* ≤ 100$, $0 ≤ *x* ≤ 100$) — the size of the set Dr. Evil owns, and the desired MEX.

翻译中…

The second line contains $*n*$ distinct non-negative integers not exceeding $100$ that represent the set.

翻译中…

Output

翻译中…

The only line should contain one integer — the minimal number of operations Dr. Evil should perform.

翻译中…

Note

翻译中…

For the first test case Dr. Evil should add $1$ and $2$ to the set performing $2$ operations.

翻译中…

For the second test case Dr. Evil should erase $0$ from the set. After that, the set becomes empty, so the MEX of it is $0$.

翻译中…

In the third test case the set is already evil.

翻译中…

样例

Input #1
5 3
0 4 5 6 7
Output #1
2
InputCopy OutputCopy
Input #2
1 0
0
Output #2
1
InputCopy OutputCopy
Input #3
5 0
1 2 3 4 5
Output #3
0
InputCopy OutputCopy
题目信息
题号
862A
时间限制
2 s
内存限制
256 MB
标签
贪心
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。