由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 请教一个迷宫题,波斯王子救公主
相关主题
请教一道面试题,判断迷宫有没有解word ladder II 找所有而不是第一个的最短路径一般咋做的?
[算法] word ladder problem问一个word ladder的题目
刚开始找工作,算法要看什么书啊?菜鸟用careercup书和leetcode准备的一点体会
请问一道google面试题Rocket Fuel面经
graph如何找最短路径?热腾腾g电面 已挂
赞人品,也发Twitter 电面面经,又挂了!!(add Amazon 1st phone interview 面经)这题怎么做?
带限制条件的最短路径题怎么做?G题求解迷津
A家电面被拒贡献个题攒人品吧L家onsite面经
相关话题的讨论汇总
话题: prince话题: princess话题: labyrinth话题: areas话题: level
进入JobHunting版参与讨论
1 (共1页)
h******r
发帖数: 201
1
这个题目应该是很经典的,可惜我一天都没弄出来。谢谢大牛们
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
l*****u
发帖数: 13
2
Dijkstra's algorithm in 3D Cube...
Dijkstra in 2D grid在一个点上下左右BFS,in 3D cube要做上下左右+下一层的BFS
1 (共1页)
进入JobHunting版参与讨论
相关主题
L家onsite面经graph如何找最短路径?
求16暑期实习内推赞人品,也发Twitter 电面面经,又挂了!!(add Amazon 1st phone interview 面经)
G家一道面试题求问带限制条件的最短路径题怎么做?
LC dp dfs bfs 中等难度题目已经刷完了大概能搞定哪种档次公司A家电面被拒贡献个题攒人品吧
请教一道面试题,判断迷宫有没有解word ladder II 找所有而不是第一个的最短路径一般咋做的?
[算法] word ladder problem问一个word ladder的题目
刚开始找工作,算法要看什么书啊?菜鸟用careercup书和leetcode准备的一点体会
请问一道google面试题Rocket Fuel面经
相关话题的讨论汇总
话题: prince话题: princess话题: labyrinth话题: areas话题: level