摘要:
//最短增广路,Dinic算法 struct Edge { int from,to,cap,flow; };//弧度 void AddEdge(int from,int to,int cap) //增弧 { edges.push_back((Edge){from,to,cap,0}); edges.push_back((Edge){to,from,0,0}); ... 阅读全文
摘要:
//最小费用最大流算法 struct Edge { int from,to,cap,flow,cost; Edge(int u,int v,int c,int f,int w):from(u),to(v),cap(c),flow(f),cost(w){} }; struct MCMF{ int n,m; vector edges; vector G[max... 阅读全文