广搜
算法知识-广搜
K.X
啤酒、饮料、矿泉水
展开
-
HDU-1312 Red and Black (BFS)
Red and Black There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From...原创 2018-07-16 21:29:45 · 184 阅读 · 0 评论 -
HDU-1253 胜利大逃亡 (BFS)
胜利大逃亡Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A...原创 2018-07-18 09:11:52 · 293 阅读 · 0 评论 -
HDU-1372 Knight Moves (BFS)
Knight MovesProblem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tou...原创 2018-07-18 09:48:07 · 164 阅读 · 0 评论 -
HDU - 2717 Catch That Cow (BFS)
Catch That CowProblem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N ...原创 2018-07-18 12:04:57 · 130 阅读 · 0 评论 -
HDU - 1242 Rescue (BFS)
RescueProblem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matr...原创 2018-07-19 09:03:05 · 177 阅读 · 0 评论 -
搜索理解(DFS BFS)
DFS: 深搜是从当前位置一次所能到达的位置,一个位置一个位置的去查找,当遇到不能在行走时(即不符合条件时),return;返回到上一层函数,当试探完一个位置后要把标记取消,也就是所说的回溯;换一个方向继续查找直到查找完所有可以到达的地方,(当然,也可以找到一条符合条件的路线后,定义一个flag不再继续进行查找下去,返回就好了;注意第一次查找到的路线不一定是最快的,与广搜不同)。...原创 2018-07-19 09:40:34 · 240 阅读 · 0 评论 -
POJ - 3026 Borg Maze (广搜+最小生成树 prim)
Borg MazeDescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term...原创 2018-07-30 17:30:18 · 156 阅读 · 0 评论 -
UVA - 439——Knight Moves
Knight MovesA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that vi...原创 2019-01-15 14:52:57 · 302 阅读 · 0 评论