2022年11月26日
摘要: 给一个图,删除一个点,问最多得到多少个块 当low[y]>dfn[x] ,发现一个割点时,删去这个点会出现新的块 ans =原来的块的个数+ 删点产生的块 #include <bits/stdc++.h> using namespace std ; const int N=1e5+1,M=5*N; 阅读全文
posted @ 2022-11-26 20:26 towboat 阅读(93) 评论(0) 推荐(0)
摘要: 找割点,且去掉这个点后 S,T 两个点在2个块中 除了dfn[x]<=low[y] , 还有 dfn[y]<=dfn[T ] #include <bits/stdc++.h> using namespace std ; const int N=2*1e5+1,M=5*1e5+1; int nxt[M 阅读全文
posted @ 2022-11-26 18:15 towboat 阅读(100) 评论(0) 推荐(0)
摘要: 给一张图加边成为双连通分量( 任意两点之间都有两条不重叠的道路) 缩点得到树,ans= (leaf_num+1)/2 一条无向边只走一次 (flag==0) #include <bits/stdc++.h> using namespace std ; const int N=6000,M=7*1e4 阅读全文
posted @ 2022-11-26 17:44 towboat 阅读(137) 评论(0) 推荐(0)
摘要: 给一个无向图,选择一些点,使得任意去掉一个点后,任一点都可以连接到至少一个选择的点 缩点后,每个块: 1. 割点数量为0, 要建立2个站点, 方案+= len(len-1) 2. 数量为1,建立1个站点 方案+=len-1 #include <bits/stdc++.h> using namespa 阅读全文
posted @ 2022-11-26 12:05 towboat 阅读(99) 评论(0) 推荐(0)
摘要: 一些直白的理解,和标准定义有差别,但也足够了 点双连通:一个图任意去掉一个点后仍然联通( 或者说任意两点件都有两条路径(无任何重叠的边) ) ; 边双连通同理 割点:去掉某个点后,图不连通 割边同理 求割点 ( low[y]>=dfn[x] ) #include <bits/stdc++.h> us 阅读全文
posted @ 2022-11-26 11:57 towboat 阅读(36) 评论(0) 推荐(0)
摘要: 从起点S到终点T,求一条路线获得最多的收益( 每个点收益a[i] ) , 可以重复通过路和点 裸题 缩点+最长路 #include <bits/stdc++.h> using namespace std ; const int N=5e5+2; int n,m,pool,a[N]; int low[ 阅读全文
posted @ 2022-11-26 01:12 towboat 阅读(30) 评论(0) 推荐(0)