#P10443. 「MYOI-R3」消消乐
「MYOI-R3」消消乐
Background
upd 2024/5/12 18:14: Added two sets of hack testdata, located in Subtask 1, worth points.
upd 2024/5/12 21:27: Added one set of hack testdata, located in Subtask 1, worth points.
Problem Description
Given a sequence of length .
Define one operation as choosing three integers such that and are pairwise distinct, then eliminate (that is, in later operations you can no longer choose ).
Ask whether, after some number of operations, it is possible to eliminate numbers among .
Input Format
The first line contains a positive integer , indicating the number of test cases.
For each test case:
The first line contains a positive integer .
The second line contains positive integers .
Output Format
For each test case, output one line containing a string Yes or No.
2
3
1 2 3
3
1 2 4
Yes
No
Hint
Sample Explanation:
- For the first test case, you can eliminate using .
- For the second test case, it can be proven that there is no solution.
Constraints
There are test points in total, and each test point is worth points.
For of the data, , , , .
Translated by ChatGPT 5