![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索-深度优先搜索
炒饭君
这个作者很懒,什么都没留下…
展开
-
POJ 3162 Walking Race (DFS + 线段树)
POJ 3162 Walking Race DFS + 线段树 #include #include #include #include using namespace std; const int maxn=1000010; struct edge{ int u,v,w; int next; edge(int u0=0,int v0=0,int w原创 2013-08-19 12:12:49 · 1242 阅读 · 0 评论 -
POJ 2196 Computer(搜索-深度优先搜索)
POJ 2196 Computer(搜索-深度优先搜索) 题目大意: 告诉你一棵树,问你某个点最远能到达多远? 解题思路: 先从1号点出发,找出各个点到1号点的距离,最远的那个点必然是树的主枝干上的一点。 从树的主干上的那点出发,距离最远的另一点必然是树主枝干的另一点。 接下来的答案就是每个点到两个主干点的距离取大。原创 2014-08-07 16:39:07 · 1073 阅读 · 0 评论