裸的最小割,转化成最大流即可。
#include <bits/stdc++.h>
int n,m;
int S,T;
int mincost;
int head[6001000],tot=1;
int cur[6001000];
int deep[1001000];
int vis[1001000];
std::queue<int>q;
struct qwq{
int to;
int nxt;
int flow;
}e[6001000];
int num(int x,int y){
return (x-1)*m+y;
}
void add(int x,int y,int z){
e[++tot]={
y,head[x],z};
head[x]=tot;
e[++tot]={
x,head[y],z};
head[y]</