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

建议使用的浏览器:

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

4369:Water World II

题目描述
  The well known PC game engineer Kevin Flynn designed a new game:Water World II.Player can enters the Virtual Water World and build the world through this game.
  Jack is the Administrator of Virtual World.He is responsible for water conservation project.Now Kevin gives him a big mission:building a reservoir made with thousands of mountain.

  Every mountain's width is 1 unit and the hight is Hi .Mountain numbered from left to right.The valley between two mountains can hold water.
  Jack can move the leftmost mountain to the rightmost for several times(include zero).
  In order to complete the project,Kevin provide k unit building materials for Jack .Jack can add them to some mountain’s top(In order to maintain the stability of reservoir,The maximum height can not be changed).
输入解释
  The input consists of several test cases(about 20).
  For each case,there are two integer n,k in first line.(0<n<=10000,0<k<=10).
  Then follow one line there are n integers indicate that the i-th mountain's height is Hi.the mountain start from left to right.(0<Hi<10000000)
输出解释
  For each case print a integer number,indicate the maximum of water it can hold.
输入样例
3 0
2 3 1
7 2
1 3 2 5 2 3 4
输出样例
1
11
提示
Case 1:
Case 2:
来自杭电HDUOJ的附加信息
Author FZU
Recommend zhuyuanchen520

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

源链接: HDU-4369

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

共提交 0

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