![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_网络流
文章平均质量分 67
HQD因为有趣所以做题
这个作者很懒,什么都没留下…
展开
-
hdu 3931 Cross the Fire
上场比赛搞毛一样,卡题卡的半死这题压根没看如果想到网络流的话,构图还是很简单的原创 2011-08-12 19:19:10 · 733 阅读 · 0 评论 -
hdu 3491 Thieves //2010 ACM-ICPC Multi-University Training Contest(6)——Host by BIT
<br />ThievesTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)<br />Total Submission(s): 421 Accepted Submission(s): 196<br /><br /><br />Problem DescriptionIn the kingdom of Henryy, there are N (2 <= N <= 100)原创 2010-10-07 20:11:00 · 910 阅读 · 0 评论 -
由HDU3472所反省的
<br />模拟做比赛,这道题是一道求混合图欧拉路的题目<br /> <br />构图就是以26个字母为节点,接着比如一个单词,那么他的首字母和尾字母且标记为0时,相当于一条单向边<br />如果标记为1,相当于一条无向边,接着构图就和求欧拉回路一样了<br /> <br />注意这是以26个字母为节点<br /> <br />如果出入度只差为奇数的点的个数不是0或者2的话,就不存在欧拉路径了,否则存在<br />如果存在奇数点个数为2的,那么当我们给出入度只差除以2的时候,只要队入度大于0的奇数点个数的那原创 2010-10-06 19:18:00 · 708 阅读 · 0 评论 -
HDU 3488 Tour //2010 ACM-ICPC Multi-University Training Contest(6)——Host by BIT
TourTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 380 Accepted Submission(s): 196Problem DescriptionIn the kingdom of Henryy, there are N (2 B->……->P->A.)Eve原创 2010-10-07 20:31:00 · 1115 阅读 · 0 评论 -
HDU 3435 A new Graph Game //KM
<br /><br /> <br /> A new Graph GameTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 250 Accepted Submission(s): 129<br /><br /><br />Problem DescriptionAn undirected graph is a graph in whi原创 2010-10-06 11:18:00 · 1405 阅读 · 0 评论 -
SGU 242. Student's Morning
242. Student's Morning time limit per test: 1 sec.memory limit per test: 6144 KBinput: standardoutput: standardOne Monday morning after some very fun party N students woke up at the flat of one of them. Notice that it was a Monday morning and every s原创 2010-10-04 14:34:00 · 808 阅读 · 0 评论 -
2道上下界的网络赛
<br />引述一下大牛的评论:<br /> <br /> <br />【题意简述】<br /><br />sgu176:给定一个有源有汇的网络,某些边要求满流,试构造一个合法方案且总流量最小。<br /><br />sgu194:给定一个无源无汇的网络,边的容量有上下界限制,试构造一个合法的流量。<br /><br />【分析】<br /><br />对于有上下界的网络流问题,我们首先应该考虑最简单的”无源无汇可行流“问题。<br />对于这个问题,我们采取的方式是构造超级源汇来解决,<br />对于所有原创 2010-10-03 19:18:00 · 671 阅读 · 1 评论 -
POJ 2396 - Budget 有源汇的上下界可行流
<br />POJ 2396 - Budget 有源汇的上下界可行流转自http://hi.baidu.com/zfy0701/blog/item/6449d82a64e15e3e5343c1ba.html<br />http://acm.pku.edu.cn/JudgeOnline/problem?id=2396<br />题目的大意是:给定一个矩阵每行,每列的和,和各个元素的限制条件(>, =, <),求出一个满足这各种限制的矩阵。<br />这个模型很类似与经典的矩阵取整模型。<br /><br />转载 2010-10-03 15:24:00 · 808 阅读 · 0 评论 -
POJ 3084 Panic Room //最小割
<br /><br />Panic RoomTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 909 Accepted: 427<br />DescriptionYou are the lead programmer for the Securitron 9042, the latest and greatest in home security software from Jellern Inc. (Motto: We secure you原创 2010-10-03 10:49:00 · 740 阅读 · 0 评论 -
pku3308 【论】如何将二分图顶点覆盖问题转化为最小割
<br />转自http://www.cnblogs.com/ylfdrib/archive/2010/08/15/1800119.html<br />在二分图中,有一个问题是,顶点覆盖问题。<br />图G的一个顶点覆盖是由一些顶点构成的集合Q包含于V(G), Q包含每条边上的至少一个端点。Q的所有顶点覆盖边集E(G)。<br />如果覆盖每个顶点需要付出不同的代价,也可以说是不同的花费,或称为点权,问题可以描述成,在保证覆盖所有边的情况下,如何使得权和最小。<br />这里只讲二分图。<br />我原创 2010-10-02 18:47:00 · 930 阅读 · 0 评论 -
POJ 3436 ACM Computer Factory
<br /><br />ACM Computer FactoryTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2259 Accepted: 744 Special Judge<br />Description<br />As you know, all the computers used for ACM contests must be identical, so the participants compete on equal te原创 2010-10-02 10:59:00 · 687 阅读 · 0 评论 -
SGU 326. Perspective //MAXFLOW
326. PerspectiveTime limit per test: 1 second(s)<br />Memory limit: 65536 kilobytesinput: standard<br />output: standard<br /><br /><br /><br />Breaking news! A Russian billionaire has bought a yet undisclosed NBA team. He's planning to invest huge effort原创 2010-10-01 10:38:00 · 851 阅读 · 2 评论 -
费用流初识
<br />费用流初识<br />费用流<br />对于f < fmax的费用流,可以把T拆成两个点,转化成最小费用最大流<br /><br />最小费用最大流<br />流量最大时费用最小,求最大费只需把值取反就行<br /><br />消圈算法:<br />可行流x为最小费用流的充要条件是残量网络中不存在负费用增广圈<br />(我还没写过)<br /><br />连续最短路径算法:<br />可证明每次增广后没有负费用圈<br />可用spfa,或者定义新的权值函数,使不存在负权,于是就可以用dijk转载 2010-10-04 19:09:00 · 1928 阅读 · 0 评论 -
2289 Jamie's Contact Groups //二分+二分图多重匹配
Jamie's Contact GroupsTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 3040 Accepted: 953DescriptionJamie is a very popular girl and has quite a lot of friends, so she always keeps a very long contact list in her cell phone. The contact list has b原创 2010-09-30 21:32:00 · 883 阅读 · 0 评论 -
hdu 1853 Cyclic Tour //km
<br /><br />Cyclic TourTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/65535 K (Java/Others)<br />Total Submission(s): 93 Accepted Submission(s): 51<br /><br /><br />Problem DescriptionThere are N cities in our country, and M one-way roads原创 2010-10-06 10:21:00 · 750 阅读 · 0 评论 -
HDU 1853 Cyclic Tour //费用流
<br />Cyclic TourTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/65535 K (Java/Others)<br />Total Submission(s): 92 Accepted Submission(s): 50<br /><br /><br />Problem DescriptionThere are N cities in our country, and M one-way roads conne原创 2010-10-05 21:59:00 · 1073 阅读 · 0 评论 -
最小费用最大流问题
◆ 最小费用最大流【MCMF问题及数学模型】 在介绍最大流问题时,我们列举了一个最大物资输送流问题。如果这个问题的已知条件还包括每条边运送单位物资的费用,那么怎样运送,才能得到最大运输量,并且输送费用最少?这便是所谓最小费用最大流问题。 在最大流的有关定义的基础上,若每条有向边除权数c(e)(表示边容量)外还有另外一个权数w(e)(表示单位流所需费用),并且已求得该网络的最大流值为F, 那么最小费用最大流问题,显然可用以下线性规划模型加以描述: Min ∑ w(e)f(e) e∈E 满足 0≤f(转载 2010-10-04 19:36:00 · 8678 阅读 · 1 评论 -
HDU 3081 Marriage Match II
<br />Marriage Match II<br />Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 457 Accepted Submission(s): 129<br /><br />Problem DescriptionPresumably, you all have known the question of stabl原创 2010-10-09 20:14:00 · 1479 阅读 · 1 评论 -
hdu 3667 Transportation //拆边费用流
<br />TransportationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 479 Accepted Submission(s): 188<br /><br /><br />Problem DescriptionThere are N cities, and M directed roads connecting the原创 2010-10-13 16:36:00 · 1256 阅读 · 1 评论 -
hdu 1565
<br />方格取数(1)Time Limit: 1000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 962 Accepted Submission(s): 359<br /><br /><br />Problem Description给你一个n*n的格子的棋盘,每个格子里面有一个非负数。<br />从中取出若干个数,使得任意的两个数所在的格子没有公共边,就原创 2011-03-04 16:12:00 · 866 阅读 · 0 评论 -
hdu 3729
去年天津赛的题目,重新看了一下题,今年去现场赛,估计能A5--6道左右吧#include #include #include using namespace std;struct node{ int val, id;}t[200];int mat[61]原创 2011-08-09 10:00:18 · 1087 阅读 · 0 评论 -
hdu 3517 Adopt or not
很明显就是求最大独立集,求什么就用什么当两边主要是找最大独立集的必须点首先是如果一个点没有匹配过,那么删除这个点,对匹配数无影响,所以一定是独立集中的接着对匹配中的点,某些点也一定是独立集中辨别的方法是,比如A和B匹配,如果A不去匹配B,而原创 2011-09-06 10:43:39 · 2281 阅读 · 0 评论 -
HDU 3917
明明是道水题,题意翻译的那叫个神马啊,第一句就开始忽悠,让别人认为连通,下面的那个忽悠,晕啊~中文意思其实几句话的事,不解释,大家都去读读题,受受折磨。最大权闭合图,纯水,不说了原创 2011-08-07 16:29:38 · 966 阅读 · 0 评论 -
hdu 3991 Harry Potter and the Present II //最小路径覆盖
很容易看出是最小路径覆盖那场比赛几乎没怎么做,弄项目了接着注意一些比较白痴的问题,比如将数组赋值为1#include #include struct EDGE{ int v, next;}edge[2010010];struct NODE{原创 2011-09-02 12:33:20 · 1090 阅读 · 0 评论 -
hdu 3987 Harry Potter and the Forbidden Forest//边数最小的最小割 2种解题方法
每条边的权值改为w*(M+1)+1最后得到的和sumsum div (M+1) 得到的是最小割的值,用(M+1)是为了不被后面的1影响到sum mod (M+1)得到的是最小割的边数,这个是在上面的最小割前提下求出来的(YY一下,在原题中可能存在多组割边,边数不同,原创 2011-09-02 11:02:52 · 1111 阅读 · 0 评论 -
hdu 3338 Kakuro Extension
最大独立集#include #include int usedif[1005];int link[1005];int mat[1005][1005];long long a[1010];int gx, gy;bool can(int t){ for(原创 2011-09-02 20:03:23 · 1227 阅读 · 0 评论 -
NOI 2009 变换序列
二分图倒序做就可以#include #include const int MAXN = 10000 + 1234;const int MAXM = 20000 + 1234;bool used[MAXN];int links[MAXN];int v原创 2011-08-02 20:24:53 · 900 阅读 · 0 评论 -
hdu 3870
这些天做的很多题都没贴代码。这是一道平面图最小割的题,贴下模板吧#include#includeconst int MAXN= 610;const __int64 maxint = 1000000000000000ll;struct edge{原创 2011-08-01 16:32:01 · 793 阅读 · 0 评论 -
hdu 3435 A new Graph Game
//邻接表 2859MS#include#includeusing namespace std;const int maxn=1010*2;const int maxm=10010*10;//最大顶点数和边数const int maxl=99999原创 2011-07-03 16:17:47 · 1375 阅读 · 0 评论 -
hdu 2732 / poj 2711 Leapin' Lizards //拆点最大流
Leapin' LizardsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1166 Accepted: 447DescriptionYour platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you are looking around for hidden treasures, one of t原创 2011-04-29 19:47:00 · 1761 阅读 · 0 评论 -
hdu 1569 方格取数(2)//最小割
<br />#include<cstdio>#include<cstring>const int MAXN=10010;const int MAXM=100000;const int INF = 0x7fffffff;struct Edge{ int st, ed,next,flow;} edge[MAXM];int head[MAXN],value[MAXN];int N, M, F, E;int src, dest;int seq原创 2011-04-28 20:32:00 · 788 阅读 · 0 评论 -
hust 1024 dance party
<br /> dance partyTime Limit: 2 Sec Memory Limit: 128 MB<br />Submissions: 324 Solved: 112<br />Description<br />You are organizing a dance party. The party will be attended by n boys and n girls. There will be several rounds of dancing.<br />In each rou原创 2011-04-27 20:27:00 · 1049 阅读 · 0 评论 -
hdu 3046 Pleasant sheep and big big wolf //最小割
/*这么大的图,差点不敢水。。。。还是用最小割水了,建图很简单,知道最小割的估计都会,不累赘了*/#include<cstdio>#include<cstring>const int N=50000;const int M=500000;const int inf=0x7fffffff;int head[N];int map[201][201];struct Edge{ int v,next,w;} edge[M];int cnt,n,s,t原创 2011-04-27 20:13:00 · 1446 阅读 · 1 评论 -
joj2730 stock
<br /> <br /> <br />/*很大的教训最小路径覆盖首先是每个点拆点的问题接着这个题目对于某一行来说,只需要找到比它大的行就可以了,不要既找到比它小的,又找到比它大的,这样会导致重复连边思考,对于每个点,只要找到比它大的,用一条路径覆盖,就是从小到大,这样就可以了*/#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int usedif[110];int l原创 2011-04-08 08:35:00 · 506 阅读 · 0 评论 -
ZOJ 2587 最小割的唯一性
<br /> <br /> <br />Unique AttackTime Limit: 5 Seconds Memory Limit: 32768 KB<br />N supercomputers in the United States of Antarctica are connected into a network. A network has a simple topology: M different pairs of supercomputers are connected t原创 2011-04-03 20:36:00 · 930 阅读 · 0 评论 -
重新总结下带上下汇的网络流的解法
<br />具体的解法参照的是北大课件的,只是总结一下,复习一下<br /> <br /> <br />有流量上下界的网络最大流<br /> 如果流网络中每条边e对应两个数字B(e)和C(e),分别表示该边上的流量至少要是B(e),最多C(e),那么,在这样的流网络上求最大流,就是有上下界的最大流问题。这种网络不一定存在可行流 思路:将下界“分离”出去,使问题转换为下界为0的普通网络流问题。 将原弧(u,v)分离出一条必要弧: 由于必要弧的有一定要满流的限制,将必要弧“拉”出来集中考虑:添加附加点x,y。原创 2011-03-05 20:34:00 · 1287 阅读 · 0 评论 -
SGU 194. Reactor Cooling
194. Reactor Cooling time limit per test: 2 sec.memory limit per test: 65536 KBinput: standardoutput: standardThe terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear reactor to produce plutonium for the nuc原创 2010-10-03 20:15:00 · 797 阅读 · 0 评论 -
POJ 3308 Paratroopers //最小割
<br /><br />ParatroopersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2357 Accepted: 753<br />Description<br />It is year 2500 A.D. and there is a terrible war between the forces of the Earth and the Mars. Recently, the commanders of the Earth原创 2010-10-02 20:04:00 · 727 阅读 · 2 评论 -
hdu 2448 Mining Station on the Sea //floyed+km算法
<br />Mining Station on the SeaTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 1213 Accepted Submission(s): 316<br /><br /><br />Problem DescriptionThe ocean is a treasure house of resources原创 2010-10-02 19:14:00 · 918 阅读 · 0 评论 -
POJ 1087 A Plug for UNIX //MAXMATCH
<br />A Plug for UNIXTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8406 Accepted: 2638<br />DescriptionYou are in charge of setting up the press room for the inaugural meeting of the United Nations Internet eXecutive (UNIX), which has an intern原创 2010-09-07 20:50:00 · 687 阅读 · 0 评论