随笔 - 531
文章 - 0
评论 - 3
阅读 -
10215
随笔分类 - 图论
网络最大流 板子
摘要:残量网络: 由 剩余容量边和反向平衡流量 的边构成 dinic算法(省去了建图与s,t) 复杂度 O(n^2 *m) const int N =1e6+4, M =5*N ; const int inf =1e15+7; int all=1,hd[N],go[M],w[M],nxt[M]; int
阅读全文
uva 247
摘要:floy 找圈 #include <iostream> #include <vector> #include <map> #include <cstring> using namespace std; const int N=300; int a[N][N],vis[N],n,m; int tot;
阅读全文
uva 1395
摘要:求图上苗条度(最大边 - 最小边) 最小的生成树 像kruskal 一样,给边排序,枚举L,R 区间,更新答案 #include <iostream> #include <cstring> #include <algorithm> using namespace std ; const int M=
阅读全文