#P2575. 高手过招
高手过招
Description
AKN got tired of playing video games, so he started a game of checkers with his teammate. The opponent is wwx. When these two ancient masters meet over the board, the game becomes unpredictable. When masters clash, there will be a winner. They both play optimally. You are given an board with some pieces on it. Who wins? AKN moves first.
The rules of the game are as follows:
- For any piece, you may move it one cell to the right. If there is a piece immediately to its right, then jump to the first empty cell to the right. If there is no empty cell to the right, you cannot move this piece. If none of the pieces can move, you lose the game.
Input Format
The first line contains , the number of test cases.
For each test case, the first line contains , indicating an board.
Then follow lines; on each line, the first number indicates that row has pieces.
It is then followed by numbers describing the piece positions in row .
Output Format
If AKN can win, print YES; otherwise, print NO.
2
1
2 19 20
2
1 19
1 18
NO
YES
Hint
of the testdata has .
Additionally, of the testdata has .
For of the testdata, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号