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

建议使用的浏览器:

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

2213:Save XX

题目描述
Once a day, XX has been caught by evil Z. WisKey, our team leader, has to rescue her. They have escaped from Z’s castle. But unfortunately, they lost in the forest. What’s more, this forest is a big maze. There is only one place to leave. Z is familiar with the forest, and he will arrive at the place in T minutes.
To make the problem simply, we assume the forest is a N*M two-dimensional array which left-top corner is (0,0) and right-bottom corner is (N-1,M-1). The place they stayed now is marked S , and the place to leave is marked E. They could only move to empty place in four directions (up, down , left, right ), or stay at the place.
>  . : empty
>  X: the tree
>  S: the place Wiskey and XX now stay
>  E: the place to leave
Your task is to give out whether they can escape.
输入解释
The input contains several test cases. Each test case starts with a line contains three number N ,M (2<= N <= 100, 2 <= M <= 100 ) indicate the size of the maze, T (2 <= T <= 20) indicate the time Z cost to arrive at E place. Then N lines follows, each line contains M character. A S and a E will be in the map.
输出解释
For each test case, you should print the number of different ways to arrive at the E place, if they can arrive at E place before T minutes. And you should print “Oh, my god, bad luck!”, if they arrive at E place at the same time with Z, because Z will catch them. Otherwise, “God will bless XX and WisKey!” should be printed.
输入样例
5 6 4
XXXX..
XS.X..
XX.XXX
XX..EX
XXXXXX
5 6 5
XXXX..
XS.X..
XX..XX
XX..EX
XXXXXX
5 6 6
XXXX..
XS.X..
XX..XX
XX..EX
XXXXXX
输出样例
God will bless XX and WisKey!
Oh, my god, bad luck!
2
来自杭电HDUOJ的附加信息
Author zjt
Recommend lcy

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

源链接: HDU-2213

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

共提交 0

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