HDU 5443 The Water Problem
来源:互联网 发布:不知道在淘宝上买什么 编辑:程序博客网 时间:2024/05/20 08:27
The Water Problem
Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 504 Accepted Submission(s): 402
Problem Description
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 a1,a2,a3,...,an 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 al and ar .
Input
First you are given an integer T(T≤10) indicating the number of test cases. For each test case, there is a number n(0≤n≤1000) on a line representing the number of water sources. n integers follow, respectively a1,a2,a3,...,an , and each integer is in {1,...,106} . On the next line, there is a number q(0≤q≤1000) representing the number of queries. After that, there will be q lines with two integers l and r(1≤l≤r≤n) indicating the range of which you should find out the biggest water source.
Output
For each query, output an integer representing the size of the biggest water source.
Sample Input
3110011 151 2 3 4 551 21 32 43 43 531 999999 141 11 22 33 3
Sample Output
1002344519999999999991
Source
2015 ACM/ICPC Asia Regional Changchun Online
分析:因为n(0≤n≤1000) q(0≤q≤1000) n*q<=1000000 直接暴力
0 0
- hdu 5443 The Water Problem
- hdu 5443 The Water Problem
- HDU 5443 The Water Problem
- hdu 5443 The Water Problem
- HDU 5443 The Water Problem
- hdu 5443 The Water Problem
- HDU 5443 The Water Problem
- hdu 5443 The Water Problem
- HDU 5443 The Water Problem 签到
- HDU 5443 The Water Problem(线段树水题)
- hdu 5443 The Water Problem(水)
- HDU 5443 The Water Problem RMQ/暴力
- HDU 5443The Water Problem 线段树
- HDU 5443 The Water Problem RMQ
- 【线段树】HDU 5443 The Water Problem
- HDU 5443 The Water Problem(ST)
- HDU 5443 The Water Problem(水)
- HDU 5443 The Water Problem【RMQ水题】
- Oracle中Rman自动备份数据库 .
- 数据库分库分表(sharding)系列(四) 多数据源的事务处理
- 乌龟git bug
- failed to update auto layout status: the agent crashed within Xcode7
- 凭什么苹果设计师年赚110万,把设计几何学融入你的产品中
- HDU 5443 The Water Problem
- Spring MVC json问题(406 Not Acceptable) 解决办法
- MediaRecoder(查看api)录制声音
- 两个超大表做关联更新的优化 之 批量更新
- 配置浪潮服务器
- 计算图片中的物体的实际尺寸的一种方法
- MyBatis入门教程(一):快速入门
- 哪本书是对程序员最有影响、每个程序员都该阅读的书?
- 面向对象的编程就是在创造世界(三)