
广搜BFS
文章平均质量分 77
搜索与图论
呵呵world
这个作者很懒,什么都没留下…
展开
-
AcWing 2548. 大胖子走迷宫 (BFS)
来源:第十届蓝桥杯国赛C++A/C/研究生组小明是个大胖子,或者说是个大大胖子,如果说正常人占用1×11×1的面积,小明要占用5×55×5的面积。由于小明太胖了,所以他行动起来很不方便。当玩一些游戏时,小明相比小伙伴就吃亏很多。小明的朋友们制定了一个计划,帮助小明减肥。计划的主要内容是带小明玩一些游戏,让小明在游戏中运动消耗脂肪。走迷宫是计划中的重要环节。朋友们设计了一个迷宫,迷宫可以看成是一个由n×nn×n个方阵组成的方阵,正常人每次占用方阵中1×11×1的区域...原创 2022-03-31 14:03:23 · 256 阅读 · 0 评论 -
Catch That Cow-抓住那头牛(BFS+队列)
Catch That CowHDU - 2717Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number li...原创 2021-07-31 08:51:18 · 639 阅读 · 0 评论 -
A strange lift - 奇怪的电梯 (BFS+队列)
A strange liftHDU - 1548There 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.When you at floor i,if you press the button "UP"..原创 2021-07-30 10:49:32 · 654 阅读 · 0 评论 -
Knight Moves -骑士移动 (BFS广搜)
Knight Moves -骑士移动 POJ - 2243A 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 visits each square of a given set of n squares on a chessboard exactly once. He thi..原创 2021-07-30 10:45:40 · 1079 阅读 · 0 评论 -
仙岛求药 (DFS深搜+最优性剪枝&&BFS广搜)
少年李逍遥的婶婶病了,王小虎介绍他去一趟仙灵岛,向仙女姐姐要仙丹救婶婶。叛逆但孝顺的李逍遥闯进了仙灵岛,克服了千险万难来到岛的中心,发现仙药摆在了迷阵的深处。迷阵由M×NM×N个方格组成,有的方格内有可以瞬秒李逍遥的怪物,而有的方格内则是安全。现在李逍遥想尽快找到仙药,显然他应避开有怪物的方格,并经过最少的方格,而且那里会有神秘人物等待着他。现在要求你来帮助他实现这个目标。输入格式第一行输入两个非零整数MM和NN,两者均不大于2020。MM表示迷阵行数,NN表示迷阵列数。接...原创 2021-07-21 17:20:25 · 384 阅读 · 0 评论