[2025 实验室二面] 无语,跟你说不下去,典型的特大男人思维
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Background
XL TECHNO -More Dance Remix- is a very attractive song, and its chart on Chunithm is equally charming and loved by players.
A senior in the lab has been training hard to achieve All Justice on XL TECHNO -More Dance Remix-, but each time he practices he always misses some note. Impatient, he decides to modify the chart to lock down the note on which he always makes a mistake.
Description
You are given an array of length and a number , where .
In one operation, you can choose any index () and set to any integer value from the range .
Find the minimum number of such operations required to satisfy the condition:
*Here, the minimum excluded (MEX) of a set of numbers is the smallest non‐negative integer that does not appear among the .
Input
The first line contains an integer (), the number of test cases. Then follow test cases, each in the following format: A line with two integers and (, ), the length of the array and the required MEX. A line with integers (), the elements of the array.
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, output a single integer—the minimum number of operations needed to make .
Sample
Input #1
5
1 0
0
3 1
0 2 3
5 5
0 1 2 3 4
6 2
0 3 4 2 6 2
7 4
0 1 5 4 4 7 3
Output #1
1
0
0
2
2
Explanation #1
In the first test case, the array is , so . By removing the 0 (or replacing it with any ), we obtain . Thus exactly one operation is required.
In the third test case, the array already contains all numbers , so initially . Since this matches the required , no changes are needed and the minimum number of operations is .