【网络流】
云淡风轻<<
这个作者很懒,什么都没留下…
展开
-
网络流小结
最大流算法模板最小费用最大流模板最大费用最大流解法:1.把所有费用变成相反数跑一遍最小费用最大流,输出答案的相反数。2.初始化spfa时dis数组全从INF改为-INF,松弛的条件从 dis[i]>dis[j]+cost[i,j]改为dis[i]<dis[j]+cost[i,j]最小割:(1)最小割定义:假设在原图中,删掉某些边,能够使得从s出发到不了t,则这些边的集...原创 2019-11-22 15:22:04 · 86 阅读 · 0 评论 -
UVA 10480(最小割/最大流/路径输出)
SabotageThe regime of a small but wealthy dictatorship has been abruptly overthrown by an unexpected rebellion.Because of the enormous disturbances this is causing in world economy, an imperialist m...原创 2019-11-22 15:19:30 · 123 阅读 · 0 评论 -
网络流最大流 ek算法模板和dinic模板
ek+邻接矩阵#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>#include<queue>using namespace std;const int maxn=205;int v[maxn][maxn];int pre[ma...原创 2019-11-19 21:23:45 · 126 阅读 · 0 评论 -
POJ 1459 Power Network(最大流 ek算法 邻接矩阵建图)
Power NetworkA power network consists of nodes (power stations, consumers anddispatchers) connected by power transport lines. A node u may besupplied with an amount s(u) >= 0 of power, may prod...原创 2019-11-18 15:51:26 · 219 阅读 · 0 评论 -
费用流模板 ek+spfa和 dinic+spfa
ek+spfa#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#include<queue>#include<string>#define ll long longusing namespace std;const i...原创 2019-11-16 15:57:08 · 208 阅读 · 0 评论 -
POJ 3436 ACM Computer Factory (网络流 dinic算法)
ACM Computer FactoryAs you know, all the computers used for ACM contests must beidentical, so the participants compete on equal terms. That is why allthese computers are historically produced at t...原创 2019-11-07 19:21:11 · 146 阅读 · 0 评论 -
POJ 3281 Dining(最大流 - EK算法)
DiningCows are such finicky eaters. Each cow has a preference for certainfoods and drinks, and she will consume no others.Farmer John has cooked fabulous meals for his cows, but he forgot tocheck...原创 2019-10-31 21:36:03 · 130 阅读 · 0 评论