#P3179. [HAOI2015] 数组游戏
[HAOI2015] 数组游戏
Description
There is an array of length . Two players, A and B, play the following game on it: initially, some cells in the array are white and some are black. The players take turns.
On each turn, the current player chooses a white cell with index . Then they choose an integer between , and flip the colors of all cells with indices . The player who cannot make a move loses.
Now A (the first player) has several queries. For each query, you are given an initial state of the array. You need to determine whether A has a winning strategy for that initial state.
Input Format
The first line contains an integer , the length of the array.
The second line contains an integer , the number of queries.
The next lines describe the queries, two lines per query.
In these two lines, the first line contains a positive integer , the number of white cells in the array. The second line contains integers between and , inclusive, which are the indices of the white cells.
Output Format
For each query, output one line with a string: output Yes if the first player has a winning strategy, otherwise output No.
3
2
2
1 2
2
2 3
Yes
No
Hint
Explanation for Sample Input/Output 1
In the first query, A chooses index and flips cells and .
In the second query, no matter which index A chooses, they can flip only one cell. B can then flip the other cell.
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, , , and no cell appears more than once within a single query.
Translated by ChatGPT 5
京公网安备 11011102002149号