Codeforces Round 682 (Div. 2)
B
Valerii Against Everyone
Codeforces
1000
原题
← AC →
翻译中…

You're given an array $b$ of length $n$. Let's define another array $a$, also of length $n$, for which $a_i = 2^{b_i}$ ($1 \leq i \leq n$).

翻译中…

Valerii says that every two non-intersecting subarrays of $a$ have different sums of elements. You want to determine if he is wrong. More formally, you need to determine if there exist four integers $l_1,r_1,l_2,r_2$ that satisfy the following conditions:

翻译中…

If such four integers exist, you will prove Valerii wrong. Do they exist?

翻译中…

An array $c$ is a subarray of an array $d$ if $c$ can be obtained from $d$ by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 100$). Description of the test cases follows.

翻译中…

The first line of every test case contains a single integer $n$ ($2 \le n \le 1000$).

翻译中…

The second line of every test case contains $n$ integers $b_1,b_2,\ldots,b_n$ ($0 \le b_i \le 10^9$).

翻译中…

Output

翻译中…

For every test case, if there exist two non-intersecting subarrays in $a$ that have the same sum, output YES on a separate line. Otherwise, output NO on a separate line.

翻译中…

Also, note that each letter can be in any case.

翻译中…

Note

翻译中…

In the first case, $a = [16,8,1,2,4,1]$. Choosing $l_1 = 1$, $r_1 = 1$, $l_2 = 2$ and $r_2 = 6$ works because $16 = (8+1+2+4+1)$.

翻译中…

In the second case, you can verify that there is no way to select to such subarrays.

翻译中…

样例

Input #1
2
6
4 3 0 1 2 0
2
2 5
Output #1
YES
NO
InputCopy OutputCopy
题目信息
题号
1438B
时间限制
1 s
内存限制
256 MB
标签
构造
数据结构
贪心
排序

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