随笔分类 -  网络流

【模板】dijstra最小费用最大流
摘要:int cnt; int h[maxn]; int prep[maxn]; int pree[maxm]; int dis[maxn]; int st = maxn - 2; int ed = maxn - 1; struct Edge { int v, nxt; int w, f; }e[maxm 阅读全文
posted @ 2019-11-27 14:53 thjkhdf12 阅读(124) 评论(0) 推荐(0)
P3381 【模板】最小费用最大流
摘要:1 #include<iostream> 2 #include<queue> 3 #include<cstring> 4 #include<cstdio> 5 using namespace std; 6 7 #define Design ios::sync_with_stdio(0),cin.ti 阅读全文
posted @ 2019-11-27 14:51 thjkhdf12 阅读(136) 评论(0) 推荐(0)
【最大流,dinic】P2766 最长不下降子序列问题
摘要:1 #include<iostream> 2 #include<string> 3 #include<queue> 4 #include<stack> 5 #include<vector> 6 #include<map> 7 #include<cstdio> 8 #include<cstdlib> 阅读全文
posted @ 2019-11-26 20:32 thjkhdf12 阅读(105) 评论(0) 推荐(0)
【最大流,dinic】P2763 试题库问题
摘要:1 #include<iostream> 2 #include<string> 3 #include<queue> 4 #include<stack> 5 #include<vector> 6 #include<map> 7 #include<cstdio> 8 #include<cstdlib> 阅读全文
posted @ 2019-11-26 19:32 thjkhdf12 阅读(97) 评论(0) 推荐(0)
【最大流,dinic】P2764 最小路径覆盖问题
摘要:1 #include<iostream> 2 #include<string> 3 #include<queue> 4 #include<stack> 5 #include<vector> 6 #include<map> 7 #include<cstdio> 8 #include<cstdlib> 阅读全文
posted @ 2019-11-26 14:03 thjkhdf12 阅读(87) 评论(0) 推荐(0)
【最大流,dinic】P2765 魔术球问题
摘要:1 #include<iostream> 2 #include<queue> 3 #include<cstdio> 4 #include<cstring> 5 #include<cmath> 6 using namespace std; 7 8 const int INF = 0x3f3f3f3f; 阅读全文
posted @ 2019-11-09 23:25 thjkhdf12 阅读(108) 评论(0) 推荐(0)
【模板】dinic算法网络最大流
摘要:int d[maxn]; int now[maxn]; int st,ed; void add_dinic(int u, int v) { e[++cnt].v = v; e[cnt].w = 0; e[cnt].nxt = head[u]; head[u] = cnt; } int dfs_din 阅读全文
posted @ 2019-11-08 22:46 thjkhdf12 阅读(149) 评论(0) 推荐(0)
【最大流,dinic】P2055 [ZJOI2009]假期的宿舍
摘要:1 #include<iostream> 2 #include<queue> 3 #include<cstring> 4 using namespace std; 5 6 const int maxn = 60; 7 8 const int INF = 0x3f3f3f3f; 9 int n; 10 阅读全文
posted @ 2019-11-08 22:44 thjkhdf12 阅读(105) 评论(0) 推荐(0)