F:ungeon Master
总时间限制: 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的更多相关文章
- Git:错误:error:src refspec master does not match any
新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...
- GIT回滚master分支到指定tag版本
master版本上线以后一般要打一个tag备份,以防事态有变,这是一个好习惯,如果以后有问题也可以放心的回滚版本,那么怎么用tag版本覆盖mastaer呢,其实只有几个命令 1.查看分支 git br ...
- git回滚远程仓库代码/错提master分支的恢复
前言 今天周五了,刚接了个新微服务模块,下班前高高兴兴开发完,提交git代码,jenkins发布到测试环境.突然看到一个提示 我最近提的代码呢?!! 想到可能会提错仓库,转念一想,不对呀,我怎有这么高 ...
- Ubuntu+Fedora进阶学习,指令迅速查询,Bug迅速查询(Ctrl+F)
There is some notes while I am learning Ubuntu Operate System! (Ask Ubuntu & Fedora) 1-- Hard li ...
- kubeadm安装K8S单master双节点集群
宿主机:master:172.16.40.97node1:172.16.40.98node2:172.16.40.99 # 一.k8s初始化环境:(三台宿主机) 关闭防火墙和selinux syste ...
- git push origin master 错误解决办法
一.错误代码如下: error: failed to push some refs to 'https://github.com/wbingithub/drag.git' 二.在网上搜了一下,如下写就 ...
- 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 ...
- git清除master分支所有commit
原理:新切一个分支并切换到这个分支,删除原来的master分支,再将新分支变成master 步骤: 1. 创建并切换到新分支 git checkout --orphan latest_branch 2 ...
- [转]Git 代码撤销、回滚到任意版本(当误提代码到本地或master分支时)
两种情况(场景) 情况一 代码还只在本地,未push到运程仓库,想把代码还原到上一次commit的代码,此时操作为代码撤销 解决方案: 1 git reset [--hard|soft|mi ...
随机推荐
- Oracle RAC安装部署文档
1. 部署环境步骤 1.1 软件环境 操作系统:CentOS release 6.5(推荐使用5.*的系统)192.168.1.151 racnode1 192.168.1.152 ...
- &和&&的区别
&和&&都可以用作逻辑与的运算符,表示逻辑与(and),当运算符两边的表达式的结果都为true时,整个运算结果才为true,否则,只要有一方为false,则结果为false. ...
- [OSG]矩阵运算
我们都知道,OpenGL规定矩阵使用列主序存储,即glLoadMatrix等函数要求输入的数组是按列主序存储的矩阵.然而,一个很奇怪的事实是,OSG中矩阵存储是使用的标准C二维数组(行主序),并且也是 ...
- c#DataGridView数据绑定示例——格式化单元格的内容(转)
转自http://blog.csdn.net/testcs_dn/article/details/37834063 c#DataGridView数据绑定示例 格式化单元格的内容 在使用DataGrid ...
- PHP将图片二进制转换
http://www.360doc.com/content/14/0325/10/947551_363526874.shtml
- 原创一看便知、Maven创建web项目
创建maven-项目 如果 pom.xml 文件报错 右击项目-->Maven-->update Project 详细步骤 上图中Next 2.继续Next 3.选maven-a ...
- 动态规划(DP)
一.基本概念 动态规划过程是:每次决策依赖于当前状态,又随即引起状态的转移.一个决策序列就是在变化的状态中产生出来的,所以,这种多阶段最优化决策解决问题的过程就称为动态规划. 二.基本思想与策略 基本 ...
- php保留键随机打乱数组顺序
最近遇到一个需求,把一个数组随机打乱顺序,我们可以用php的shuffle函数,但是这个函数会把数组的键清空建立新的键,那么我们若想保留键只需要利用shuffle函数再做一下处理就可以了.可以自定义一 ...
- Gbase数据库备份与还原
备份命令:cd D:\GeneralData\GBase\Server\bin 回车 后 : d : 回车 后: dump.exe -usysdba(u+用户名) -pbj ...
- fiddler_技巧01
1.选择一个包后,要点击 "Inspectors"标签页 才能有"Raw"标签页 才能看到原始的详细信息 2. 3. 4. 5.