摘要:
洛谷P2756 匈牙利算法: #include<bits/stdc++.h> using namespace std; const int N=110; int match[N],vis[N]; int n,m; vector<int> edges[N]; bool dfs(int u){ for( 阅读全文
posted @ 2025-10-07 15:41
xdhking
阅读(6)
评论(0)
推荐(0)
摘要:
方法 二分图转换成网络流模型;创建虚拟源点和汇点,将源点连上左边所有点,右边所有点连上汇点,容量皆为1。原来的每条边从左往右连边,容量也皆为1,最大流即最大匹配。 code:洛谷P3386 dinic: #include<bits/stdc++.h> using namespace std; typ 阅读全文
posted @ 2025-10-07 13:04
xdhking
阅读(24)
评论(0)
推荐(0)

浙公网安备 33010602011771号