Codeforces Round 960 (Div. 2)
A
Submission Bait
Codeforces
900
原题
←B →
翻译中…

Alice and Bob are playing a game in an array $a$ of size $n$.

翻译中…

They take turns to do operations, with Alice starting first. The player who can not operate will lose. At first, a variable $mx$ is set to $0$.

翻译中…

In one operation, a player can do:

翻译中…
  • Choose an index $i$ ($1 \le i \le n$) such that $a_{i} \geq mx$ and set $mx$ to $a_{i}$. Then, set $a_{i}$ to $0$.
翻译中…

Determine whether Alice has a winning strategy.

翻译中…

Input

翻译中…

The first line contains an integer $t$ ($1 \leq t \leq 10^3$) — the number of test cases.

翻译中…

For each test case:

翻译中…
  • The first line contains an integer $n$ ($2 \leq n \leq 50$) — the size of the array.
  • The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq n$) — the elements of the array.
翻译中…

Output

翻译中…

For each test case, if Alice has a winning strategy, output "YES". Otherwise, output "NO".

翻译中…

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

翻译中…

Note

翻译中…

In the first test case, Alice can choose $i=1$ since $a_1=2 \ge mx=0$.

翻译中…

After Alice's operation, $a=[0,1]$ and $mx=2$. Bob can not do any operation. Alice wins.

翻译中…

In the second test case, Alice doesn't have a winning strategy.

翻译中…

For example, if Alice chooses $i=1$, after Alice's operation: $a=[0,1]$ and $mx=1$. Then, Bob can choose $i=2$ since $a_2=1 \ge mx=1$. After Bob's operation: $a=[0,0]$ and $mx=1$. Alice can not do any operation. Bob wins.

翻译中…

样例

Input #1
5
2
2 1
2
1 1
3
3 3 3
4
3 3 4 4
4
1 2 2 2
Output #1
YES
NO
YES
NO
YES
InputCopy OutputCopy
题目信息
题号
1990A
时间限制
1 s
内存限制
256 MB
标签
暴力
博弈论
贪心
排序

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