第五篇英语翻译


重点单词:

dungeon n.地牢;

diagonal adj.对角的,斜的,斜线的;n.斜线,对角线;

出处:https://acs.jxnu.edu.cn/problem/NOIOPJCH02051253

Dungeon Master

 1000ms  65536K

描述:

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonally and the maze is surrounded by solid rock on all sides. 你被困在一个3维的地牢里,需要找到再快的路径逃出!地牢由一些可能装满了岩石的方格构成。每次朝着北,南,东,西,上和下移动一格需要花费1分钟。你不能倾斜着移动,同时迷宫周围被岩石包围 不能出去;
Is an escape possible? If yes, how long will it take? 你是否能逃脱? 如果能,你需要多长时间?

输入:

The input consists of a number of dungeons. Each dungeon description starts with a line containing three integers L, R and C (all limited to 30 in size). 输入包含多个地牢。每一个地牢开始都有三个整数L,R,C(他们都小于30);
L is the number of levels making up the dungeon. L是描述地牢有多少层;
R and C are the number of rows and columns making up the plan of each level. 每一层都由R行C 列组成
Then there will follow L blocks of R lines each containing C characters. Each character describes one cell of the dungeon. A cell full of rock is indicated by a '#' and empty cells are represented by a '.'. Your starting position is indicated by 'S' and the exit by the letter 'E'. There's a single blank line after each level. Input is terminated by three zeroes for L, R and C. 接下来是L层由R行包含C个元素的地牢。每一个元素占一个方格。‘#’表示是岩石,‘.’表示一个空白区域。你开始的地方由‘S’表示,你出去的地方由‘E;表示。每一层描述完后有一行空白。 地牢由输入3个0结束

输出:

Each maze generates one line of output. If it is possible to reach the exit, print a line of the form
Escaped in x minute(s).

where x is replaced by the shortest time it takes to escape.
If it is not possible to escape, print the line
Trapped!

样例输入:

3 4 5
S....
.###.
.##..
###.#

#####
#####
##.##
##...

#####
#####
#.###
####E

1 3 3
S##
#E#
###

0 0 0

样例输出:

Escaped in 11 minute(s).
Trapped!

相关