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

建议使用的浏览器:

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

5433:Xiao Ming climbing

题目描述
Due to the curse made by the devil,Xiao Ming is stranded on a mountain and can hardly escape.

This mountain is pretty strange that its underside is a rectangle which size is $n*m$ and every little part has a special coordinate$(x,y)$and a height $H$.

In order to escape from this mountain,Ming needs to find out the devil and beat it to clean up the curse.

At the biginning Xiao Ming has a fighting will $k$,if it turned to $0$ Xiao Ming won't be able to fight with the devil,that means failure.

Ming can go to next position$(N,E,S,W)$from his current position that time every step,$(abs(H_1-H_2))/k$ 's physical power is spent,and then it cost $1$ point of will.

Because of the devil's strong,Ming has to find a way cost least physical power to defeat the devil.

Can you help Xiao Ming to calculate the least physical power he need to consume.
输入解释
The first line of the input is a single integer $T (T \leq 10)$, indicating the number of testcases.

Then $T$ testcases follow.

The first line contains three integers $n,m,k$ ,meaning as in the title$(1 \leq n,m \leq 50, 0 \leq k \leq 50)$.

Then the $N$ × $M$ matrix follows.

In matrix , the integer $H$ meaning the height of $(i,j)$,and '#' meaning barrier (Xiao Ming can't come to this) .

Then follow two lines,meaning Xiao Ming's coordinate$(x_1,y_1)$ and the devil's coordinate$(x_2,y_2)$,coordinates is not a barrier.
输出解释
For each testcase print a line ,if Xiao Ming can beat devil print the least physical power he need to consume,or output "$No Answer$" otherwise.

(The result should be rounded to 2 decimal places)
输入样例
3
4 4 5
2134
2#23
2#22
2221
1 1
3 3
4 4 7
2134
2#23
2#22
2221
1 1
3 3
4 4 50
2#34
2#23
2#22
2#21
1 1
3 3
输出样例
1.03
0.00
No Answer
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5433

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

共提交 3

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