K - Children of the Candy Corn(待续)
K - Children of the Candy Corn
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Description
One popular maze-walking strategy guarantees that the visitor will eventually find the exit. Simply choose either the right or left wall, and follow it. Of course, there's no guarantee which strategy (left or right) will be better, and the path taken is seldom the most efficient. (It also doesn't work on mazes with exits that are not on the edge; those types of mazes are not represented in this problem.)
As the proprieter of a cornfield that is about to be converted into a maze, you'd like to have a computer program that can determine the left and right-hand paths along with the shortest path so that you can figure out which layout has the best chance of confounding visitors.
Input
Exactly one 'S' and one 'E' will be present in the maze, and they will always be located along one of the maze edges and never in a corner. The maze will be fully enclosed by walls ('#'), with the only openings being the 'S' and 'E'. The 'S' and 'E' will also be separated by at least one wall ('#').
You may assume that the maze exit is always reachable from the start point.
Output
Sample Input
2
8 8
########
#......#
#.####.#
#.####.#
#.####.#
#.####.#
#...#..#
#S#E####
9 5
#########
#.#.#.#.#
S.......E
#.#.#.#.#
#########
Sample Output
37 5 5 17 17 9
//还没看懂题
K - Children of the Candy Corn(待续)的更多相关文章
- poj 3083 Children of the Candy Corn
点击打开链接 Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8288 ...
- Children of the Candy Corn 分类: POJ 2015-07-14 08:19 7人阅读 评论(0) 收藏
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10933 Acce ...
- POJ3083——Children of the Candy Corn(DFS+BFS)
Children of the Candy Corn DescriptionThe cornfield maze is a popular Halloween treat. Visitors are ...
- POJ 3083 Children of the Candy Corn bfs和dfs
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8102 Acc ...
- POJ 3083:Children of the Candy Corn(DFS+BFS)
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9311 Accepted: ...
- poj3083 Children of the Candy Corn BFS&&DFS
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11215 Acce ...
- POJ 3083 -- Children of the Candy Corn(DFS+BFS)TLE
POJ 3083 -- Children of the Candy Corn(DFS+BFS) 题意: 给定一个迷宫,S是起点,E是终点,#是墙不可走,.可以走 1)先输出左转优先时,从S到E的步数 ...
- POJ 3083:Children of the Candy Corn
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11015 Acce ...
- POJ 3083 Children of the Candy Corn 解题报告
最短用BFS即可.关于左手走和右手走也很容易理解,走的顺序是左上右下. 值得注意的是,从起点到终点的右手走法和从终点到起点的左手走法步数是一样. 所以写一个左手走法就好了.贴代码,0MS #inclu ...
随机推荐
- Mysql 中文中繁杂的字 插入报错的 解决方案
首先 数据库默认编码选用 utf8 连接字符串也相应改成utf8,不能是gb2312
- Python闭包的高级应用-装饰器的实现
我们先看一个闭包的例子: from time import ctime def before_call(f): def wrapped(*args, **kargs): print 'before c ...
- odoo8编辑视图中sheet边距过宽问题调整
在Odoo8的Form视图中,预设有一个sheet的边距,这样看起来像是在一页纸上录入信息,但因为现在的显示器比较宽,预设的sheet宽度比较小,这样看起来就浪费了大量的空间,尤其是明细字段比较多的时 ...
- hdu1010 dfs+路径剪枝
题意:用一个案例来解释 4 4 5 S.X. ..X. ..XD .... 在这个案例中,是一个4*4的地图. . 表示可走的地方, X 表示不可走的地方,S表示起始点,D表示目标点.没走到一个点之后 ...
- HTML5开发移动web应用——Sencha Touch篇(10)
我们把数据可视化出来,为的就是进行一些针对数据的操作. 这里介绍一下DataView的排序功能和搜索功能. 掌握这两个技能,能够让写出的数据界面内的数据能够依据要求进行排序,能够进行数据的搜索显示灯功 ...
- <转>sock代理服务原理(TCP穿透)
原文转自:http://www.cppblog.com/zuhd/archive/2010/06/08/117366.html sock代理分为sock4代理和 sock5代理.sock4支持TCP( ...
- SqlServer+Topshelf+Quartznet做集群,定时任务分布式处理
接触Quartznet之前,老东家用的是总监自己写的分布式任务框架,好用但是配置麻烦,unity,一个微软容器,配置节点错一个,整个使用到unity文件的项目全部跑不起来,这后果真的受不了... 目前 ...
- hibernate(jpa)中注解配置字段为主键
http://www.blogjava.net/ITdavid/archive/2009/02/25/256605.html 注解方式的主键配置 非自增字段为主键,注解annotation表示 ...
- ibatis 动态列查询问题解决
http://hi.baidu.com/java513/blog/item/ace7c516c400390d4a90a7c8.html 这个问题是因为你查询的sql的列是变化的,但是ibati ...
- Rabbitmq消息队列(二) Hello World! 模拟简单发送接收
1.简介 RabbitMQ是消息代理:它接受和转发消息.你可以把它当作一个邮局:当你把你要邮寄的邮件放在信箱里时,你可以肯定Postman先生最终会把邮件送到你的收件人那里.在这个比喻中,Rabbit ...