深度优先搜索(DFS)
文章平均质量分 84
01的世界
有时,失去了才懂得珍惜
展开
-
poj2386--图的遍历 最基础的
E - Lake CountingCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionDue to recent rains,原创 2015-08-11 11:18:58 · 446 阅读 · 0 评论 -
例题7-7 天平难题 UVa1354 **
题目:给出房间的宽度r和s个挂坠的重量wi。设计一个尽量宽(但宽度不能超过房间宽度r)的天平,挂住所有挂坠分析:这题果然是难题啊,我果然不会啊,看了题解,没搞明白,照着敲了遍,以后回来再看看参考这个博客看懂了一点点:点击打开链接代码:#include#include#includeusing namespace std;struct Tree { double L原创 2015-10-02 18:36:36 · 449 阅读 · 0 评论 -
例题 6-12 油田 UVa 572 用dfs求连通块
572 - Oil DepositsTime limit: 3.000 secondsOil DepositsThe GeoSurvComp geologic survey company is responsible fordetecting underground oil deposits. GeoSurvComp works with onelarge r原创 2015-09-18 22:25:04 · 656 阅读 · 0 评论 -
习题6-4 骑士的移动 UVa 439
UVA - 439Knight MovesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmitStatus DescriptionA friend of you is doing research on t原创 2015-07-12 20:59:11 · 467 阅读 · 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 · 406 阅读 · 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 · 353 阅读 · 0 评论 -
Educational Codeforces Round 7 Codeforces 622D Codeforces 622E
题目:622CNot Equal on a Segment分析:对于这题,对于连续相等数字做一下压缩处理,如果相等的直接跳到下一个不等的位置在比较就好了,O(N)的时间压缩预处理,查询O(1)。题目:622DOptimal Number Permutation分析:这是道找规原创 2016-03-11 09:41:28 · 366 阅读 · 0 评论