图论:强连通
文章平均质量分 71
skajre
这个作者很懒,什么都没留下…
展开
-
POJ 2186 Popular Cows(korasaju Algorithm求强连通分量)
//// main.cpp// Richard//// Created by 邵金杰 on 16/8/18.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#include#includeusing namespace std;const int maxn=100原创 2016-08-18 09:22:59 · 239 阅读 · 0 评论 -
POJ 1236 Network of Schools(korasaju Algorithm求强连通子集,缩点后DAG上出或入度为0的点)
//// main.cpp// Richard//// Created by 邵金杰 on 16/8/17.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#include#includeusing namespace std;const int maxn=100原创 2016-08-18 13:56:43 · 333 阅读 · 0 评论 -
POJ 1236 Network of Schools(Tarjan Algorithm求强连通子集,缩点后DAG上出或入度为0的点)
//// main.cpp// Richard//// Created by 邵金杰 on 16/8/17.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#include#include#includeusing namespace std;const int原创 2016-08-18 14:25:12 · 238 阅读 · 0 评论 -
POJ 3180 The Cow Prom(Tarjan Algorithm求强连通子集)
//// main.cpp// Richard//// Created by 邵金杰 on 16/8/18.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#include#includeusing namespace std;const int maxn=100原创 2016-08-18 21:59:13 · 218 阅读 · 0 评论 -
POJ 2553 The Bottom of a Graph(Tarjan Algorithm强连通分量)
如果v能到w,w能到v那么v成为slink,v和w不一定直接相连。直接找强连通分量,然后缩点,枚举桥即可。//// main.cpp// Richard//// Created by 邵金杰 on 16/8/18.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#i原创 2016-08-19 15:37:30 · 233 阅读 · 0 评论 -
POJ 3114 Countries in War(强连通分量 最短路)
//// main.cpp// Richard//// Created by 邵金杰 on 16/8/18.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#include#include#includeusing namespace std;const int原创 2016-08-19 17:27:36 · 258 阅读 · 0 评论 -
POJ 3160 Father Christmas flymouse(强连通分量+spfa最长路)
最近老是莫名其妙1A。//// main.cpp// Richard//// Created by 邵金杰 on 16/8/18.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#include#include#include#includeusing namespace s原创 2016-08-19 19:25:52 · 394 阅读 · 1 评论 -
UVA 12167 Proving Equivalences(强连通)
注意最后需要枚举所有不是强连通内部边的边。#include#include#include#include#include#includeusing namespace std;const int maxn=20000+5;vector G[maxn];int pre[maxn],lowlink[maxn],sccno[maxn],dfs_clock,scc_cnt;stack原创 2016-11-13 12:43:15 · 204 阅读 · 0 评论 -
UVA 11324 The Largest Clique(强连通+dp)
#include#include#include#include#include#includeusing namespace std;const int maxn=1000+5;struct edge{int u,v;}e[50000+5];vector G[maxn];int pre[maxn],lowlink[maxn],sccno[maxn],dfs_clock,scc原创 2016-11-13 15:50:56 · 191 阅读 · 0 评论