dfs&bfs
RRicky_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【HDU1312】A - Red and Black(bfs)
题目链接 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 tile原创 2017-07-31 22:31:45 · 361 阅读 · 0 评论 -
[HDU1241] C - Oil Deposits(dfs&bfs)
Oil Deposits The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid tha原创 2017-07-31 22:58:57 · 396 阅读 · 0 评论 -
【bfs与dfs】基础
bfs : 广度优先搜索,一层一层搜索. 属于一种盲目搜寻法,目的是系统地展开并检查图中的所有节点,以找寻结果。换句话说,它并不考虑结果的可能位置,彻底地搜索整张图,直到找到结果为止。广度优先的基本思想是,从顶点v0出发,访问与v0相邻的点,访问结束后,再从这些点出发,继续访问,直到访问结束为止。标记被访问过的点同深搜一下,不过,广度优先一般需要用到队列。 dfs : 深度优先搜索原创 2017-08-04 23:14:09 · 281 阅读 · 0 评论 -
【杭电oj1010 】- Tempter of the Bone(dfs,奇偶剪枝)
Tempter of the BoneTempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 127135 Accepted Submission(s): 34284Problem Descriptio原创 2017-08-01 17:56:16 · 402 阅读 · 0 评论 -
dfs【奇偶剪枝】
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 我们现假设从 0 开始走,则不难证明, 从任意 0 走到任意 1 始终是奇数步; 从任意 0 走到任意 0 始终是偶数步; 设开头为s,右下为e,s 到 e 的最短步数为 t,则从 s 到 e 的步数之和(或者说总距离)总可以表示成 sum= t extra ( extra>=0 )原创 2017-08-01 17:35:27 · 476 阅读 · 0 评论 -
[CodeForces510B] - Fox And Two Dots(dfs)
题目Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like this: Each cell contains a dot that has some color. We will use different原创 2017-07-31 23:06:14 · 424 阅读 · 0 评论
分享