当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6483:A Sequence Game

题目描述
One day, WNJXYK found a very hard problem on an Online Judge. This problem is so hard that he had been thinking about the solutions for a couple of days. And then he had a surprise that he misunderstood that problem and easily figured out a solution using segment tree. Now he still wonders that solution for the misread problem.
There is a sequence with $N$ positive integers $A1$,$A2$,...,$An$ and $M$ queries. Each query will give you an interval [L,R] and require an answer with YES/NO indicates that whether the numbers in this interval are continuous in its integer range.
Let us assume that the maximal number in an interval is $mx$ and the minimal number is $mi$. The numbers in this interval are continuous in its integer range means that each number from $mi$ to $mx$ appears at least once in this interval.
输入解释
The input starts with one line contains exactly one positive integer $T$ which is the number of test cases. And then there are T cases follow.
The first line contains two positive integers $n$,$m$ which has been explained above.The second line contains positive integers $A1$,$A2$,...,$An$.
Then there will be m lines followed. Each line contains to positive numbers $Li$,$Ri$ indicating that the ith query’s interval is [$Li$,$Ri$].
输出解释
For each test case, output m line.
Each of following m lines contains a single string “YES”/ “NO” which is the answer you have got.
输入样例
2
3 3
3 1 2 
2 3
1 3
1 2
5 3
1 2 2 4 5 
1 5
1 3
3 3
输出样例
YES
YES
NO
NO
YES
YES
提示
T=5
1<=n<=100000
1<=Ai<=10^9
1<=m<=100000
The input file is very large, so you are recommend to use scanf() and printf() for IO.
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6483

最后修改于 2020-10-25T23:31:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)