上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 94 下一页

2012年9月29日

最大流模板(SAP算法)(邻接表形式)

摘要: 最大流的SAP模板,用了很多次了。今天总结贴下(虽然代码不够精简,但是自己写的也总算看起来明白些,不容易错)据说没有可以卡SAP的最大流。。。const int MAXN=20010;//点数的最大值const int MAXM=880010;//边数的最大值const int INF=0x3f3f3f3f;struct Node{ int from,to,next; int cap;}edge[MAXM];int tol;int head[MAXN];int dep[MAXN];int gap[MAXN];//gap[x]=y :说明残留网络中dep[i]==x的个数为yint ... 阅读全文

posted @ 2012-09-29 08:34 kuangbin 阅读(3176) 评论(3) 推荐(0) 编辑

2012年9月28日

POJ 3133 Manhattan Wiring (插头DP)

摘要: Manhattan WiringTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 1110Accepted: 634DescriptionThere is a rectangular area containing n × m cells. Two cells are marked with “2”, and another two with “3”. Some cells are occupied by obstacles. You should connect the two “2”s and also the tw 阅读全文

posted @ 2012-09-28 16:35 kuangbin 阅读(1427) 评论(0) 推荐(0) 编辑

2012年9月27日

ZOJ 3207 80ers' Memory(水题)

摘要: 80ers' MemoryTime Limit: 1 Second Memory Limit: 32768 KBI guess most of us are so called 80ers, which means that we were born in the 1980's. This group of people shared a lot of common memories. For example, the Saint Seiya, the YoYo ball, the Super Mario, and so on. Do you still remember th 阅读全文

posted @ 2012-09-27 18:24 kuangbin 阅读(500) 评论(1) 推荐(0) 编辑

ZOJ 3204 Connect them (最小生成树,输出字典序最小的解)

摘要: Connect themTime Limit: 1 Second Memory Limit: 32768 KBYou have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that is connecting computers i and j is the same as connecting computers j and i). The cost of connect. 阅读全文

posted @ 2012-09-27 16:23 kuangbin 阅读(1521) 评论(1) 推荐(0) 编辑

ZOJ 3203 Light Bulb (数学直接推公式 或者 三分法)

摘要: ZOJ Problem Set - 3203Light BulbTime Limit: 1 Second Memory Limit: 32768 KBCompared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodious house, thinking of how to ea 阅读全文

posted @ 2012-09-27 15:37 kuangbin 阅读(2948) 评论(0) 推荐(0) 编辑

2012年9月23日

HDU 4417 Super Mario 第37届ACM/ICPC 杭州赛区网络赛第1008题 (划分树)

摘要: Super MarioTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 120Accepted Submission(s): 73Problem DescriptionMario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble aga 阅读全文

posted @ 2012-09-23 20:44 kuangbin 阅读(1432) 评论(3) 推荐(0) 编辑

HDU 4417 Super Mario 第37届ACM/ICPC 杭州赛区网络赛1008题(树状数组或者线段树)

摘要: Super MarioTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 80Accepted Submission(s): 42Problem DescriptionMario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble agai 阅读全文

posted @ 2012-09-23 19:39 kuangbin 阅读(2030) 评论(8) 推荐(0) 编辑

HDU 4419 Colourful Rectangle 第37届ACM/ICPC 杭州赛区网络赛 1010题 (线段树)

摘要: Colourful RectangleTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12Accepted Submission(s): 3Problem DescriptionWe use Red, Green and Blue to make new colours. See the picture below:Now give you n rectangles, the colour of them is red or green or 阅读全文

posted @ 2012-09-23 17:14 kuangbin 阅读(1350) 评论(0) 推荐(0) 编辑

HDU 3829 Cat VS Dog (二分匹配求最大独立集)

摘要: Cat VS DogTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 1770Accepted Submission(s): 600Problem DescriptionThe zoo have N cats and M dogs, today there are P children visiting the zoo, each child has a like-animal and a dislike-animal, if the chil 阅读全文

posted @ 2012-09-23 10:25 kuangbin 阅读(981) 评论(0) 推荐(0) 编辑

HDU 2710 Max Factor (水题)

摘要: Max FactorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2238Accepted Submission(s): 684Problem DescriptionTo improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the 阅读全文

posted @ 2012-09-23 09:25 kuangbin 阅读(1449) 评论(0) 推荐(0) 编辑

上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 94 下一页

导航

JAVASCRIPT: