![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
网络流
文章平均质量分 57
网络最大流,最小费用最大流等
海马有力量
Ship it!
展开
-
P3381 【模板】最小费用最大流
P3381 【模板】最小费用最大流 输入输出样例 输入 4 5 4 3 4 2 30 2 4 3 20 3 2 3 20 1 2 1 30 9 1 3 40 5 输出 50 280 最小费用最大流就在最大流的基础上增加费用,要使费用最小。解题方法是最短路+最大流,先用最短路在残留网络上求得费用最小的路径,然后更新路径的容量。因为路径的费用有负的,所以最短路使用spfa算法。 #include<cstdio> #include<iostream> #include<cstr原创 2021-05-01 16:16:10 · 145 阅读 · 0 评论 -
【hdoj4280】Island Transport(最大流ISPA)
Island Transport Problem Description In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships. You have a transportation company there. Some routes are opened原创 2021-04-30 16:45:53 · 115 阅读 · 1 评论 -
P3376 【模板】网络最大流(EK)&【poj1532】Drainage Ditches(Dinic)
P3376 【模板】网络最大流 最大流解决的问题就是求出原点到汇点能流过的最大流量。普通的搜索会使一些路径的流量用不到(残量),EK算法就是每次得到一条路径的流量(增广路),正向减,反向加,通过不断搜索得到最大流。 #include<cstdio> #include<cstring> #include<algorithm> #include<queue> using namespace std; const int N=205; const int inf=原创 2021-04-30 10:38:41 · 101 阅读 · 0 评论