bfs
nucleare
这个作者很懒,什么都没留下…
展开
-
Catch That Cow(bfs启蒙题)
Catch That Cow(百练4001)Farmer 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 ...原创 2018-04-22 20:56:12 · 304 阅读 · 0 评论 -
B - Children of the Candy Corn(双dfs+bfs)
The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and other terrors on their que...原创 2018-05-24 21:10:25 · 138 阅读 · 0 评论 -
H - Hiking Trip (bfs+priority_queue)
Hiking in the mountains is seldom an easy task for most people, as it is extremely easy to get lost during the trip. Recently Green has decided to go on a hiking trip. Unfortunately, half way through ...原创 2018-05-07 20:59:00 · 268 阅读 · 0 评论 -
B - 胜利大逃亡 (三维数组的bfs)
Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每分钟能从一个坐标走到相邻的六个坐标中的其中一个.现在给你城堡的地图,请你计算出Ig...原创 2018-05-03 20:54:45 · 144 阅读 · 0 评论 -
C - Nightmare (双bfs)
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial ...原创 2018-05-03 15:05:26 · 186 阅读 · 0 评论 -
D - Prime Path
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 offices. — It is a matter of sec...原创 2018-05-02 20:37:37 · 161 阅读 · 0 评论 -
A - A strange lift (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.When you at floor i,if...原创 2018-05-02 17:20:01 · 130 阅读 · 0 评论 -
K - 迷宫问题
K - 迷宫问题 定义一个二维数组: 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 × ...原创 2018-04-24 21:55:11 · 310 阅读 · 0 评论 -
Stealing Harry Potter's Precious HDU - 4771 (BFS+状态压缩dp)
Stealing Harry Potter's PreciousHDU - 4771 Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back ...原创 2019-03-09 13:18:52 · 185 阅读 · 0 评论