#P3901. 数列找不同

    ID: 2838 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>模拟莫队排序进制概率论,统计

数列找不同

Description

Given a sequence A1,A2,,ANA_1, A_2, \ldots, A_N and QQ queries (Li,Ri)(L_i, R_i), determine whether ALi,ALi+1,,ARiA_{L_i}, A_{L_i+1}, \ldots, A_{R_i} are all different from each other.

Input Format

The first line contains two integers N,QN, Q.
The second line contains NN integers A1,A2,,ANA_1, A_2, \ldots, A_N.
Then QQ lines follow, each containing two integers Li,RiL_i, R_i.

Output Format

For each query, output one line: Yes or No.

4 2
1 2 3 2
1 3
2 4
Yes
No

Hint

For 50%50\% of the testdata, N,Q103N, Q \le 10^3.
For 100%100\% of the testdata, 1N,Q1051 \le N, Q \le 10^5, 1AiN1 \le A_i \le N, 1LiRiN1 \le L_i \le R_i \le N.

Translated by ChatGPT 5