
深度优先搜索(DFS)
文章平均质量分 84
01的世界
有时,失去了才懂得珍惜
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj2386--图的遍历 最基础的
E - Lake Counting Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Description Due to recent rains,原创 2015-08-11 11:18:58 · 477 阅读 · 0 评论 -
例题7-7 天平难题 UVa1354 **
题目:给出房间的宽度r和s个挂坠的重量wi。设计一个尽量宽(但宽度不能超过房间宽度r)的天平,挂住所有挂坠 分析:这题果然是难题啊,我果然不会啊,看了题解,没搞明白,照着敲了遍,以后回来再看看 参考这个博客看懂了一点点:点击打开链接 代码: #include #include #include using namespace std; struct Tree { double L原创 2015-10-02 18:36:36 · 506 阅读 · 0 评论 -
例题 6-12 油田 UVa 572 用dfs求连通块
572 - Oil Deposits Time limit: 3.000 seconds Oil Deposits The GeoSurvComp geologic survey company is responsible fordetecting underground oil deposits. GeoSurvComp works with onelarge r原创 2015-09-18 22:25:04 · 695 阅读 · 0 评论 -
习题6-4 骑士的移动 UVa 439
UVA - 439 Knight Moves Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description A friend of you is doing research on t原创 2015-07-12 20:59:11 · 523 阅读 · 0 评论 -
Codeforces 598D Igor In the Museum (dfs)
Igor is in the museum and he wants to see as many pictures as possible.Museum can be represented as a rectangular field of n × m cells. Each cell is either empty or impassable. Empty cells are marked原创 2016-01-16 14:47:08 · 458 阅读 · 0 评论 -
Saving James Bond - Easy Version 简单dfs
This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of drug dealers. He was sent to a small piece of land原创 2015-11-30 23:57:31 · 388 阅读 · 0 评论 -
Educational Codeforces Round 7 Codeforces 622D Codeforces 622E
题目: 622C Not Equal on a Segment 分析: 对于这题,对于连续相等数字做一下压缩处理,如果相等的直接跳到下一个不等的位置在比较就好了,O(N)的时间压缩预处理,查询O(1)。 题目: 622D Optimal Number Permutation 分析: 这是道找规原创 2016-03-11 09:41:28 · 396 阅读 · 0 评论