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

建议使用的浏览器:

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

5443:The Water Problem

题目描述
In Land waterless, water is a very limited resource. People always fight for the biggest source of water. Given a sequence of water sources with $a_1, a_2, a_3, . . . , a_n$ representing the size of the water source. Given a set of queries each containing $2$ integers $l$ and $r$, please find out the biggest water source between $a_l$ and $a_r$.
输入解释
First you are given an integer $T (T \leq 10)$ indicating the number of test cases. For each test case, there is a number $n (0 \leq n \leq 1000)$ on a line representing the number of water sources. $n$ integers follow, respectively $a_1, a_2, a_3, . . . , a_n$, and each integer is in $\{1, . . . , 10^6\}$. On the next line, there is a number $q (0 \leq q \leq 1000)$ representing the number of queries. After that, there will be $q$ lines with two integers $l$ and $r (1 \leq l \leq r \leq n)$ indicating the range of which you should find out the biggest water source.
输出解释
For each query, output an integer representing the size of the biggest water source.
输入样例
3
1
100
1
1 1
5
1 2 3 4 5
5
1 2
1 3
2 4
3 4
3 5
3
1 999999 1
4
1 1
1 2
2 3
3 3
输出样例
100
2
3
4
4
5
1
999999
999999
1
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5443

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

共提交 0

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