广度优先搜索
凛冬天明
这个作者很懒,什么都没留下…
展开
-
poj3278 Catch That Cow
POJ2378 Catch That Cow 简单BFS传送门 Catch That Cow Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts原创 2017-08-09 20:52:21 · 291 阅读 · 0 评论 -
POJ3126Prime Path 暴力BFS
POJ3126Prime Path 暴力BFS传送门The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their office原创 2017-08-09 20:53:38 · 282 阅读 · 0 评论 -
POJ3087 Shulle'm up 模拟
POJ3087 Shulle’m up 模拟传送门A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stac原创 2017-08-09 20:54:06 · 477 阅读 · 0 评论 -
POJ2251 Dungeon Master 三维BFSmd
POJ2251 Dungeon Master 三维BFS传送门分析:一个三维的地图,要求输出从‘S’到‘E’的最短步数,如果到不了,就输出Trapped!<这道题目自己写了好几遍,第一次是超内存了,很明显的数组开大了,之后又T了,被F调教代码,最后才发现,原来越界条件的应该是||的关系。我一开始写的是&&的关系 逃)>// main.cpp// whr_bfs///原创 2017-08-09 20:54:26 · 229 阅读 · 0 评论 -
HDU1548 A strange life BFS
HDU1548 A strange life BFS传送门There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.原创 2017-08-09 20:55:53 · 195 阅读 · 0 评论 -
POJ 3984 迷宫问题 手写队列+BFS路径输出
POJ 3984 迷宫问题 手写队列+BFS路径输出传送门定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5原创 2017-08-09 20:56:28 · 304 阅读 · 0 评论