#include<bits/stdc++.h>
using namespace std;
char buf[1<<20],*_=buf,*__=buf;
#define gc() (_==__&&(__=(_=buf)+fread(buf,1,1<<20,stdin),_==__)?EOF:*_++)
#define TT template<class T>inline
TT bool read(T &x){
x=0;char c=gc();bool f=0;
while(c<48||c>57){
if(c==EOF)return 0;f^=(c=='-'),c=gc();}
while(47<c&&c<58)x=(x<<3)+(x<<1)+(c^48),c=gc();
if(f)x=-x;return 1;
}
TT bool read(T&a,T&b){
return read(a)&&read(b);}
TT bool read(T&a,T&b,T&c){
return read(a)&&read(b)&&read(c);}
typedef long long ll;
const ll MAXN=5008,mod=1e9+7,inf=0x3f3f3f3f;
struct Mcfm{
struct E{
int y,nt;ll flow,cost;}e[MAXN*20];
int head[MAXN],cnt=1;
void add(int x,int y,ll flow,ll cost){
//x->y
e[++cnt].y=y;
e[cnt].flow=flow;
e[cnt].cost=cost;
e[cnt].nt=head[x];head[x]=cnt;
}
int n,m,s,t;
int dis[MAXN],<
费用流
最新推荐文章于 2023-12-31 19:44:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)