随笔 - 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 阅读全文
posted @ 2022-10-25 23:31 towboat 阅读(20) 评论(0) 推荐(0) 编辑
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; 阅读全文
posted @ 2022-10-25 22:53 towboat 阅读(20) 评论(0) 推荐(0) 编辑
uva 1395
摘要:求图上苗条度(最大边 - 最小边) 最小的生成树 像kruskal 一样,给边排序,枚举L,R 区间,更新答案 #include <iostream> #include <cstring> #include <algorithm> using namespace std ; const int M= 阅读全文
posted @ 2022-10-25 21:20 towboat 阅读(12) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示