总时间限制: 1000ms 内存限制: 65536kB
描述
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.

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 is the number of levels making up the dungeon. 
R and C are the number of rows and columns making up the plan of each level. 
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.
输出
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!

F:ungeon Master的更多相关文章

  1. Git:错误:error:src refspec master does not match any

    新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...

  2. GIT回滚master分支到指定tag版本

    master版本上线以后一般要打一个tag备份,以防事态有变,这是一个好习惯,如果以后有问题也可以放心的回滚版本,那么怎么用tag版本覆盖mastaer呢,其实只有几个命令 1.查看分支 git br ...

  3. git回滚远程仓库代码/错提master分支的恢复

    前言 今天周五了,刚接了个新微服务模块,下班前高高兴兴开发完,提交git代码,jenkins发布到测试环境.突然看到一个提示 我最近提的代码呢?!! 想到可能会提错仓库,转念一想,不对呀,我怎有这么高 ...

  4. Ubuntu+Fedora进阶学习,指令迅速查询,Bug迅速查询(Ctrl+F)

    There is some notes while I am learning Ubuntu Operate System! (Ask Ubuntu & Fedora) 1-- Hard li ...

  5. kubeadm安装K8S单master双节点集群

    宿主机:master:172.16.40.97node1:172.16.40.98node2:172.16.40.99 # 一.k8s初始化环境:(三台宿主机) 关闭防火墙和selinux syste ...

  6. git push origin master 错误解决办法

    一.错误代码如下: error: failed to push some refs to 'https://github.com/wbingithub/drag.git' 二.在网上搜了一下,如下写就 ...

  7. git push后出现错误 ![rejected] master -> master(non-fast-forward) error:failed to push some refs to 'XXX'

    本地创建了一个project并在GitHub上创建了一个仓库,想要将本地的仓库链接到远程仓库我用的是如下方法:git init    //初始化本地仓库git remote add origin XX ...

  8. git清除master分支所有commit

    原理:新切一个分支并切换到这个分支,删除原来的master分支,再将新分支变成master 步骤: 1. 创建并切换到新分支 git checkout --orphan latest_branch 2 ...

  9. [转]Git 代码撤销、回滚到任意版本(当误提代码到本地或master分支时)

    两种情况(场景) 情况一      代码还只在本地,未push到运程仓库,想把代码还原到上一次commit的代码,此时操作为代码撤销 解决方案: 1 git reset [--hard|soft|mi ...

随机推荐

  1. jqGrid subGrid配置 如何首次加载动态展开所有的子表格

    有时候需求需要默认加载表格的时候把子表格的数据也显示出来,经过研究相关SubGrids API配置如下: 属性 类型 描述 默认值 subGrid boolean 设置为true启用子表格.如果启用子 ...

  2. Logstash学习-Hello World

    1.安装 rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearchcat > /etc/yum.repos.d/l ...

  3. 你年纪轻轻怎么这么"不讲理"

    今天在公交上遇到一出"精彩的打戏",这给我的12月份带来了一丝的"惊喜",1号就能让我碰到这样的事,看来这个月会惊喜不断啊!!!! 这精彩的戏是这样的,公交到了 ...

  4. jsp中button与submit的用法

    button:可以对返回的数据进行格式化,反应到页面上,可以用form表单序列化提交也可以不用form表单提交 <form id="addForm"> <inpu ...

  5. 20160712001 SQL server R2 更名

    use mastergoselect @@servername;select serverproperty('servername') sp_dropserver 'BPM-SERVER'gosp_a ...

  6. Unity中各类物理投射性能横向比较

    最近在优化摄像机部分代码,抽了个时间对物理投射这块进行了系统性的测试,发现了不少东西 测试工程下载地址: http://files.cnblogs.com/files/hont/RaycastTest ...

  7. DllImport attribute的总结

    C#有没有方法可以直接都用已经存在的功能(比如Windows中的一些功能,C++中已经编写好的一些方法),而不需要重新编写代码? 答案是肯定,就是通过接下来要说的 DllImport . DllImp ...

  8. Trading

    http://v.youku.com/v_show/id_XMTA0OTcxMjgw.html?from=y1.2-1-87.3.8-1.1-1-1-7

  9. rethinkdb的dataexplorer查询使用

    首先安装rethinkdb(只有linux和mac能够安装) $ sudo apt-get install rethinkdb 然后启动: $ rethinkdb 此时8080端口就可以访问本机的数据 ...

  10. Xcode 8

    (一)Xcode8去掉多余LOG 1.打开我们的项目,进入EditScheme 2.我们在Environment Variables中添加OS_ACTIVITY_MODE=disable