网络流
coldfresh
那我们开始吧
展开
-
Drainage Ditches HDU - 1532 (网络流之最大流)(EdmondsKarp算法)
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, Far原创 2017-08-19 21:21:58 · 329 阅读 · 0 评论 -
Battle HDU - 3061(最大权闭合子图)
由于小白同学近期习武十分刻苦,很快被晋升为天策军的统帅。而他上任的第一天,就面对了一场极其困难的战斗: 据侦查兵回报,前方共有N座城池,考虑到地势原因,最终得到一个结论:攻占某些城池之前必须攻占另外一些城池。 事实上,可以把地图看做是一张拓扑图,而攻占某个城池,就意味着必须先攻占它的所有前驱结点。 小白还做了一份调查,得到了攻占每个城池会对他的兵力产生多少消耗(当然也可能会得到增长,因为原创 2017-11-06 15:24:09 · 299 阅读 · 0 评论 -
Base Station HDU - 3879(最大权闭合子图)
A famous mobile communication company is planning to build a new set of base stations. According to the previous investigation, n places are chosen as the possible new locations to build those new stat原创 2017-11-06 15:08:06 · 316 阅读 · 0 评论 -
Island Transport HDU - 4280 (无向图形网络流)
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原创 2017-11-05 15:59:56 · 607 阅读 · 0 评论 -
网络流二·最大流最小割定理 HihoCoder - 1378
传送门问题关键是求是点的最小割级点,实质上个只要在增广完毕后的参量网络中,从源点出发做一次bfs即可,即可把所有的割点找出#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<queue>#define INF 0x3f3f3f3fusing namespace std;const int原创 2017-11-03 14:33:37 · 336 阅读 · 0 评论 -
网络流五·最大权闭合子图 HihoCoder - 1398
传送门问题就是如何把最大权闭合子图问题转化成最大流实现,中间需要经过一个最小割的概念,证明涉及到简单割,简单割对应一个闭合子图#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<queue>#define INF 0x3f3f3f3fusing namespace std;const in原创 2017-11-03 16:06:47 · 327 阅读 · 0 评论 -
Going Home HDU - 1533(最小费用最大流)
On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. For each little man, you need to原创 2017-10-25 00:04:37 · 264 阅读 · 0 评论 -
Being a Hero HDU - 3251 (最小割)
You are the hero who saved your country. As promised, the king will give you some cities of the country, and you can choose which ones to own! But don’t get too excited. The cities you take should NOT原创 2017-11-10 01:01:09 · 346 阅读 · 0 评论 -
Game HDU - 3657(还是算最小割吧)
onmylove has invented a game on n × m grids. There is one positive integer on each grid. Now you can take the numbers from the grids to make your final score as high as possible. The way to get score i原创 2017-11-08 23:56:19 · 353 阅读 · 0 评论 -
方格取数(2) HDU - 1569(二分图最大点权独立集)
给你一个m*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取数所在的2个格子不能相邻,并且取出的数的和最大。 Input 包括多个测试实例,每个测试实例包括2整数m,n和m*n个非负数(m<=50,n<=50) Output 对于每个测试实例,输出可能取得的最大的和 Sample Input 3 3 75 15 21原创 2017-11-08 22:51:21 · 453 阅读 · 0 评论 -
Thieves HDU - 3491(最小点割集)
In the kingdom of Henryy, there are N (2 <= N <= 100) cities, with M (M <= 10000) two-direct ways connecting them. A group of thieves from abroad plan to steal the metropolitan museum in city H (It h原创 2017-11-08 16:19:16 · 370 阅读 · 0 评论 -
Marriage Match II HDU - 3081 (二分答案+最大流+并查集)
Presumably, you all have known the question of stable marriage match. A girl will choose a boy; it is similar as the game of playing house we used to play when we are kids. What a happy time as so many原创 2017-10-30 18:14:36 · 285 阅读 · 0 评论 -
Tour HDU - 3488(带权二分匹配)(最小花费最大流)
In the kingdom of Henryy, there are N (2 <= N <= 200) cities, with M (M <= 30000) one-way roads connecting them. You are lucky enough to have a chance to have a tour in the kingdom. The route should be原创 2017-11-07 14:37:47 · 402 阅读 · 0 评论 -
Task Schedule HDU - 3572(dinic最大流)
Our geometry princess XMM has stoped her study in computational geometry to concentrate on her newly opened factory. Her factory has introduced M new machines in order to process the coming N tasks. Fo原创 2017-10-29 00:04:03 · 262 阅读 · 0 评论 -
Escape HDU - 3605 (最大流)(多重匹配)
2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some stars, who can live, but some people do not fit to live some of the planet. Now scientists wan原创 2017-09-15 11:45:49 · 417 阅读 · 0 评论 -
网络流三·二分图多重匹配 HihoCoder - 1393
描述学校的秋季运动会即将开始,为了决定参赛人员,各个班又开始忙碌起来。小Hi和小Ho作为班上的班干部,统计分配比赛选手的重任也自然交到了他们手上。已知小Hi和小Ho所在的班级一共有N名学生(包含小Hi和小Ho),编号依次为1..N。运动会一共有M项不同的比赛,编号为1..M。第i项比赛每个班需要派出m[i]名选手参加。根据小Hi和小Ho的统计,编号为i的学生表示最多同时参加a[i]项比赛,并且给出他原创 2017-09-14 22:23:36 · 295 阅读 · 0 评论 -
Pahom on Water HDU - 4183(最大流)
Pahom on Water is an interactive computer game inspired by a short story of Leo Tolstoy about a poor man who, in his lust for land, forfeits everything. The game’s starting screen displays a number of原创 2017-11-06 15:48:09 · 320 阅读 · 0 评论