Codeforces Round 905 (Div. 1) |
---|
Finished |
You had a sequence $$$a_1, a_2, \ldots, a_n$$$ consisting of integers from $$$1$$$ to $$$n$$$, not necessarily distinct. For some unknown reason, you decided to calculate the following characteristic of the sequence:
Each test consist of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of the lost sequence $$$a$$$.
The second line of each test case contains $$$n$$$ integers $$$r_1, r_2, \ldots, r_n$$$ ($$$i \le r_i \le n+1$$$) — the characteristic of the lost sequence $$$a$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output the following:
532 3 452 3 5 4 61131 3 483 6 6 6 8 9 9 9
Yes 1 2 1 No Yes 1 No Yes 1 3 5 3 5 1 1 3
In the first test case, the sequence $$$a = [1, 2, 1]$$$ is suitable. The integers $$$1$$$ and $$$2$$$ appear on the subsegments $$$[1, 2]$$$ and $$$[2, 3]$$$.
In the second test case, it can be proved that there is no suitable sequence $$$a$$$.
Name |
---|