![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tarjan
蜗角虚名羊
这个作者很懒,什么都没留下…
展开
-
强联通/lca tarjan
强联通: hdu3861 The King’s Problem#include<cstdio>#include<cstring>#include<queue>using namespace std;const int N=50003,M=100003,inf=1e8原创 2018-05-17 22:29:08 · 179 阅读 · 0 评论 -
bzoj4326: NOIP2015 运输计划
题目题解:大佬的博客 思路其实很简单,就是tarjan求lca+二分答案+树上差分(貌似不需要解释,看到这个思路就应该基本上会写了吧),实现起来也听简单的#include<bits/stdc++.h>using namespace std;const int N=300003;struct node{ int to,w,ne;}e[N<<1...原创 2018-05-31 20:24:55 · 313 阅读 · 0 评论 -
51nod1815 调查任务
题目 题解 使模最大就是找某条路径上的严格次大值,由于一个点可以通过多次,那门可以tarjan缩点,处理出每个联通快的最大值与次小值,剩下就是在DAG图上bfs计算答案。(注意次小值需在最大值路径上)#include<bits/stdc++.h>using namespace std;const int M=4000002,N=400002;queue<in...转载 2018-07-12 12:52:17 · 328 阅读 · 0 评论