
双连通分量
文章平均质量分 81
fan12110501019
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 3694 Network
http://poj.org/problem?id=3694 tarjan算法的应用,数组开的要大,还有新加的边。 #include #include #include #define maxn 201105 using namespace std; int e,low[maxn],dfn[maxn],dfs_clock,f[maxn],num,b[maxn],n,m,head[max原创 2014-02-12 21:14:26 · 530 阅读 · 0 评论 -
poj 2186 Popular Cows
http://poj.org/problem?id=2186 题意: N头奶牛,给出若干欢迎关系a,b,表示a欢迎b,欢迎关系是单向的,但也是可以传递的,另外每个奶牛都是欢迎他自己的。求出被所有奶牛欢迎的奶牛的数目。 #include #include #include #include #include #define maxn 100001 using namespace st原创 2014-02-13 19:49:38 · 458 阅读 · 0 评论 -
poj 3592 Instantaneous Transference
http://poj.org/problem?id=3592 这道题先有tarjan算法缩点,然后再建图,再有spfa算法求最长路。 #include #include #include #include #define maxn 300000 using namespace std; const int inf=-1<<30; int e,head[maxn],belong[max原创 2014-02-16 17:20:53 · 418 阅读 · 0 评论 -
poj 3114 Countries in War
http://poj.org/problem?id=3114 这道题和poj 3592 一样,先缩点再spfa求最短路 #include #include #include #include #define maxn 300000 using namespace std; const int inf=1<<30; int head[maxn],head1[maxn],dfn[maxn原创 2014-02-18 08:22:51 · 426 阅读 · 0 评论