
割点割边
Dave_L
这个作者很懒,什么都没留下…
展开
-
双连通分量模板(点/边)
在一个连通图中,任意两个点都能通过至少两条不经过同一个点的路径而互相到达,就说明它是点双连通的。 点双连通分量:任意两点之间的两条路径之间没有公共的边void Tarjan( int x , int fa ){ int son = 0; DFN[x] = LOW[x] = ++index1; for( int i = head[x] ; ~i ; i = G[i].nex原创 2018-03-09 11:27:49 · 735 阅读 · 0 评论 -
Mining Your Own Business UVALive - 5135
John Digger is the owner of a large illudium phosdex mine. The mine is made up of a series of tunnels that meet at various large junctions. Unlike some owners, Digger actually cares about the welfare原创 2018-03-09 11:18:31 · 341 阅读 · 0 评论 -
51nod1076 2条不相交的路径
1076 2条不相交的路径基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题给出一个无向图G的顶点V和边E。进行Q次查询,查询从G的某个顶点V[s]到另一个顶点V[t],是否存在2条不相交的路径。(两条路径不经过相同的边)(注,无向图中不存在重边,也就是说确定起点和终点,他们之间最多只有1条路)原创 2018-03-08 16:29:25 · 351 阅读 · 0 评论 -
有向图强连通分量模板
#include using namespace std;const int AX = 1e3+66;struct Node{ int v; int next1;}G[AX];int head[AX];int vis[AX]; int tot = 0;int index = 0 ;int DFN[AX], LOW[AX];int cnt = 0;void add(原创 2018-03-09 11:40:53 · 472 阅读 · 0 评论