网络流强化-HDU2732
第一次遇到加了“多余”的边会导致WA的——在我看来是很多余,见代码191行 之后会思考为什么,想出来再更。 //http://www.renfei.org/blog/isap.html 带解释的 //https://www.cnblogs.com/bosswnx/p/10353301.html 形式和我的比较相近的 #include<cstdio> #include<cstring> #include<cmath> using namespace std; #define maxe 100024 //pay 双向边 一共10万条路 双向就是20万 反边就是40万 #define maxv 1024 //pay #define maxn 25 //pay #define sc scanf #define pt printf #define rep(i,a,b) for(int i=(a);i<(b);++i) const int inf = 0x3f3f3f3f; int cg,sp,ins; //cg change sp是总流量 ins是加速回溯点 int N,M,T,D ,s,t,delta; int q[maxv],fro,rea; typedef struct ed{ int v,nxt,cap; //dis }ed; ed e[maxe]; int tot