由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 请教一个迷宫题,波斯王子救公主 (转载)
相关主题
MatLab Code[合集] 请问binary searth tree的遍历问题。
C -> assemblyAn interview question
streamwriter and filestreamBFS traversal starting from leaf level ???
请问遍历树可以用for loop来完成吗?这个题目能否半小时完成coding?
烤树题。问个题:use caching for parallel BFS (转载)
问个算法问题请教一个graph问题
请问如何才能对binary tree的题大小通吃?按层遍历二叉树,常量空间,如何做到?
算法的课怎么这么难???工作总结,.net 方向的,大牛就不用看了。 (转载)
相关话题的讨论汇总
话题: prince话题: princess话题: labyrinth话题: areas话题: level
进入Programming版参与讨论
1 (共1页)
h******r
发帖数: 201
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: hihibear (嗨嗨熊), 信区: JobHunting
标 题: 请教一个迷宫题,波斯王子救公主
发信站: BBS 未名空间站 (Wed Dec 30 13:05:17 2015, 美东)
这个题目应该是很经典的,可惜我一天都没弄出来。谢谢大牛们
The Prince of Persia has been thrown onto the top level of Jaffar's
underground labyrinth. The labyrinth consists of h levels strictly on top of
each other. Each level is split into m by n areas. Some areas have columns
that support ceiling, some areas are free. The Prince can move only to free
areas. To move to the level below the Prince can break the floor underneath
him and jump down if there is no column underneath. Every move takes the
Prince 5 seconds. A Princess is waiting for the Prince at the lowest level.
Write a program that will help the Prince to save the Princess as fast as
possible by finding the shortest path between them and outputting time it
took the Prince to find the Princess. The structure of the labyrinth is
given bellow. The Prince’s location is marked with '1', the Princess’s
location is marked with '2'. ‘.’ - marks a free spot and ‘o’ marks a
column.
1 . .
o o .
. . .
o o o
. . o
. o o
o o o
o . .
o . 2
p***o
发帖数: 1252
2
BFS

of
columns
free
underneath

【在 h******r 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: hihibear (嗨嗨熊), 信区: JobHunting
: 标 题: 请教一个迷宫题,波斯王子救公主
: 发信站: BBS 未名空间站 (Wed Dec 30 13:05:17 2015, 美东)
: 这个题目应该是很经典的,可惜我一天都没弄出来。谢谢大牛们
: The Prince of Persia has been thrown onto the top level of Jaffar's
: underground labyrinth. The labyrinth consists of h levels strictly on top of
: each other. Each level is split into m by n areas. Some areas have columns
: that support ceiling, some areas are free. The Prince can move only to free
: areas. To move to the level below the Prince can break the floor underneath

1 (共1页)
进入Programming版参与讨论
相关主题
工作总结,.net 方向的,大牛就不用看了。 (转载)烤树题。
这段代码花很长时间,为什么?问个算法问题
guvest老哥不好意思了请问如何才能对binary tree的题大小通吃?
[转载] 简单的题都不敢做了.算法的课怎么这么难???
MatLab Code[合集] 请问binary searth tree的遍历问题。
C -> assemblyAn interview question
streamwriter and filestreamBFS traversal starting from leaf level ???
请问遍历树可以用for loop来完成吗?这个题目能否半小时完成coding?
相关话题的讨论汇总
话题: prince话题: princess话题: labyrinth话题: areas话题: level