搜索
dfs和bfs的学习
鳳九~
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ZOJ - 1649 Rescue(dfs)
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison. Angel’s friends want to ...原创 2019-07-31 08:49:48 · 266 阅读 · 0 评论 -
POJ 3050 Hopscotch(dfs暴力)
The cows play the child’s game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5 rectilinear grid of digits parallel to the x an...原创 2020-02-15 20:25:58 · 285 阅读 · 1 评论 -
POJ 3984-迷宫问题 (dfs)
定义一个二维数组: 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 × 5的二维数组,表示一个迷宫。数据保...原创 2020-02-03 21:45:45 · 252 阅读 · 1 评论 -
POJ 2243 Knight Moves bfs
A 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 chessbo...原创 2019-07-27 15:08:54 · 144 阅读 · 0 评论 -
HDU - 1251 统计难题
Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串. 注意:本题...原创 2019-08-11 16:39:55 · 214 阅读 · 0 评论 -
HDU - 1548 A strange lift(dfs)
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...原创 2019-07-28 18:12:37 · 183 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone(dfs+剪枝)
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone ...原创 2019-08-01 14:28:37 · 349 阅读 · 10 评论 -
HDU - 1016 Prime Ring Problem(dfs)
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number of fir...原创 2019-07-31 09:08:31 · 125 阅读 · 0 评论
分享