![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网络流
天涯-沧海
acmer
展开
-
(最大流) 2020牛客多校第一场 i 1 or 2
这i题我一直在想点和边进行建图,真tm的sb,这样根本没办法保证一条边和它的两个点都选上了,其实应该就点和点连边,每个点拆成i和i',源点和i连一条权值为di的边,i'和汇点连一条权值为di的边,对于m条边,u和v,u于v'建边,v与u'建边,这样每个点的流量都只能流到其他点,最大流就是让每个点都选了di条边,只要源点汇点流量等于di的和就是答案了链接:https://ac.nowcoder.com/acm/contest/5666/I来源:牛客网时间限制:C/C++ 1秒,其他语言2秒...原创 2020-07-12 17:48:58 · 1085 阅读 · 5 评论 -
Magic Potion CFGym 101981I(网络流)
题意:n个英雄打m个怪兽,每个英雄只能打自己集合的怪兽,并且只能打一只,还有k个药水,一个英雄用一个药水能多打一只怪兽,问所有一共最多能打多少只怪兽思路:一开始想的二分匹配,但药水实在不好分配,赛后看题解发现就是一简单网络流,还是题目做少了。建图:1.源点和每个英雄连边,权值1, 2.源点和药水连边,权值为k 3.药水和每个英雄连边,权值...原创 2019-10-21 18:17:33 · 147 阅读 · 0 评论 -
POJ 1273 Drainage Ditches(网络流首次ac纪念)
Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Fa...原创 2019-09-23 20:38:24 · 81 阅读 · 0 评论 -
The Perfect Stall(网络流)
DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new barn are differen...原创 2019-09-24 23:09:49 · 224 阅读 · 0 评论 -
POJ 1698 Alice's Chance
DescriptionAlice, a charming girl, have been dreaming of being a movie star for long. Her chances will come now, for several filmmaking companies invite her to play the chief role in their new films...原创 2019-09-25 21:30:01 · 170 阅读 · 0 评论 -
POJ 2112 Optimal Milking
DescriptionFJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths runs among the cows and the mi...原创 2019-09-25 23:24:23 · 138 阅读 · 0 评论 -
POJ 1637 Sightseeing tour(网络流,混合欧拉回路)
The city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautiful city. They want to construct the tour so that every street...原创 2019-09-26 22:27:09 · 124 阅读 · 0 评论 -
Power Network(网络流)
DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produc...原创 2019-09-27 20:31:43 · 1121 阅读 · 0 评论