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

建议使用的浏览器:

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

2445:Little White's Explore

题目描述
Little White likes exploring. One day she finds a maze which has a shape of a rectangle of size n*m. The coordinate of the entrance is (1,1) and the precious deposits are place at (n,m).Except for these two positions, other grids' height change from time to time. At beginning,they all have the maximum height, and every second their height change by 1(increase or decrease). The grid cannot be stayed on if its height is smaller than min. Little White can jump upwards at most high meters and downwards low meters at a time. Every time, she can choose to go to the adjacent grids(up, down, left or right) or stay at the same grid. There is a lamp at grid (n,m) with height 10. Every time she jumps from i to j, she wishes to see the light of the lamp the moment she gets onto j. Little White has a height 10 and 100 units of power,which decrease by 1 unit for every second. It takes one second for her to jump from one grid to another, and the grids' height always change after her jump. She will always be at the center of the grids.
输入解释
For each data set:
The first line give five integers, n, m, min, high, low(2<=n,m<=35,min>=0,high>=0,low>=0).
The next n lines, each has m integers, indicating the grids' initial and maximum height.The height of the grid first decreases, then begins to increase when it gets to 0, and then begins to decrease when it gets maximum...
输出解释
Print the minimum time required to get to the precious deposits. If she cannot get to the destination, print -1 instead.
输入样例
5 5 0 1 1
18 20 20 20 20
18 20 20 20 20
18 20 18 18 18
18 20 18 20 18
18 18 18 20 7
5 5 7 5 8
23 16 3 2 28
26 8 1 16 19
16 17 26 12 4
30 1 3 3 4
14 4 7 28 12
输出样例
25
-1

提示
The rectangle has n rows and m columns. The entrance (1,1) is at the top left corner.
She can see the light if it is only blocked by the side of some grids.
Both Little White and the lamp are to be considered as points, placed at the center of the grid.
Her power must be greater than 0 at any given time during her exploration. 
来自杭电HDUOJ的附加信息
Recommend gaojie

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

源链接: HDU-2445

最后修改于 2020-10-25T22:53:30+00:00 由爬虫自动更新

共提交 0

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