![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dfs和bfs
Bigdz
新手一枚,大神们就不要来--------你懂得
展开
-
poj-1979-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 a tile, he can move to one of four adjacent tiles. But he can'原创 2017-07-24 14:21:17 · 219 阅读 · 0 评论 -
hdu-1372-Knight Moves(bfs和dfs)
题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1372 BFS: 从起始点开始,每次对于满足题意的点,进行不满足题意的判断并且标记上该点的该次的计数(有时,可能为0或1,对于本题就是从起点走到次点的步数)。我们可以想象出一步一层的结构。为了完成这部分的操作,我们需要使用队列来完成,它每次的对于该层的判断,满足先进先出的原原创 2017-07-25 09:14:12 · 283 阅读 · 0 评论 -
poj-2718-Smallest Difference(dfs)
题目转送门:http://poj.org/problem?id=2718 好激动尽然过了,调了好几个小时,一直超时,网上的代码,大部分为两种做法: 一个是用next_permutation枚举全排列 另一个是 dfs暴力枚举 但是要注意一点,如果是下面的这种写法就会超时: #include #include #include #include原创 2017-07-25 14:01:21 · 255 阅读 · 0 评论 -
hdu-1010-Tempter of the Bone
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原创 2017-03-08 20:11:44 · 343 阅读 · 0 评论