摘要: 视频链接:https://www.bilibili.com/video/BV1sZ4y1i7NZ #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N=100010,M 阅读全文
posted @ 2022-06-28 08:04 董晓 阅读(1042) 评论(1) 推荐(0)
摘要: 视频链接:https://www.bilibili.com/video/BV1SU4y1D77p/ // Luogu P3381 【模板】最小费用最大流 #include <iostream> #include <cstring> #include <algorithm> #include <que 阅读全文
posted @ 2022-06-25 22:07 董晓 阅读(818) 评论(0) 推荐(3)
摘要: 视频链接:https://www.bilibili.com/video/BV1iG411s7iX/ //Luogu P1344 [USACO4.4]追查坏牛奶Pollutant Control #include <iostream> #include <cstring> #include <algo 阅读全文
posted @ 2022-06-25 09:13 董晓 阅读(1195) 评论(2) 推荐(2)
摘要: 视频链接:https://www.bilibili.com/video/BV18F411c7M1 // Luogu P3376 【模板】网络最大流 #include <iostream> #include <cstring> #include <algorithm> #include <queue> 阅读全文
posted @ 2022-05-28 13:36 董晓 阅读(1445) 评论(5) 推荐(7)
摘要: D20 网络流 最大流 EK 算法_哔哩哔哩_bilibili P3376 【模板】网络最大流 - 洛谷 #include <iostream> #include <cstring> #include <algorithm> #include <queue> #define LL long long 阅读全文
posted @ 2022-05-28 13:34 董晓 阅读(1192) 评论(2) 推荐(0)
摘要: D19 vDCC 缩点 Tarjan 算法_哔哩哔哩_bilibili vDCC:不删除边,分裂割点,构成的连通块 把 vDCC 缩成点,把缩点和割点对应连边,构成树 1. cut[x] 记录割点,dcc[] 记录 vDCC,id[] 割点的编号 2. 每次回溯:判割点,记录 vDCC 3. 特判孤 阅读全文
posted @ 2022-05-28 13:33 董晓 阅读(1209) 评论(2) 推荐(2)
摘要: D18 eDCC 缩点 Tarjan 算法_哔哩哔哩_bilibili eDCC:删除割边后的连通块。cnt 条割边,cnt+1 个eDCC 1. 缩点:x → dcc[x],n → cnt 2. 割边即树边:bri[i]=bri[i^1]=1 3. 割边出点的度:du[dcc[to[i]]]++ 阅读全文
posted @ 2022-05-28 13:32 董晓 阅读(1405) 评论(1) 推荐(2)
摘要: D17 割边 Tarjan 算法_哔哩哔哩_bilibili P1656 炸铁路 - 洛谷 1. 割点判定:low[y]>=dfn[x]。允许走反边更新 low 值 割边判定:low[y]>dfn[x]。不允许走反边更新 low 值 2. 若 y 已访问且不是反边,更新 low 值 3. 判反边:链 阅读全文
posted @ 2022-05-28 13:31 董晓 阅读(1531) 评论(0) 推荐(4)
摘要: D16 割点 Tarjan 算法_哔哩哔哩_bilibili P3388 【模板】割点(割顶) - 洛谷 有向图:强连通分量、缩点 无向图:割点、割边、点双连通分量、边双连通分量、缩点 1. 割点:删掉后使图从连通变成不连通的点 2. 判儿子:low[y]>=dfn[x](说明 y 没有连通 x 之 阅读全文
posted @ 2022-05-28 13:30 董晓 阅读(1570) 评论(0) 推荐(4)
摘要: D15 SCC 缩点 Tarjan 算法_哔哩哔哩_bilibili P2812 校园网络【[USACO]Network of Schools加强版】 - 洛谷 图问题:有向无向?有环无环?连通不连通?正权负权? 1. 把SCC缩成一个点,旧点 x → 缩点 scc[x],n → cnt 2. 统计 阅读全文
posted @ 2022-05-28 13:29 董晓 阅读(1751) 评论(0) 推荐(2)