摘要: RobberiesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4953Accepted Submission(s): 1878Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because th. 阅读全文
posted @ 2012-08-18 17:20 Suhx 阅读(316) 评论(0) 推荐(0) 编辑
摘要: I NEED A OFFER!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9932Accepted Submission(s): 3687Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他. 阅读全文
posted @ 2012-08-17 22:09 Suhx 阅读(2312) 评论(0) 推荐(1) 编辑
摘要: 网上找到的一份比较好的关于网络流最大流的资料,学习下...图-1 如图-1所示,在这个运输网络中,源点S和汇点T分别是1,7,各边的容量为C(u,v)。图中红色虚线所示就是一个可行流。标准图示法如图-2所示: 其中p(u,v) / c(u,v)分别表示该边的实际流量与最大容量。 关于最大流 熟悉了什么是网络流,最大流也就很好理解了。就是对于任意的u∈V-{s},使得p(s,u)的和达到最大。上面的运输网络中,最大流如图-3所示:MaxFlow=p(1,2)+p(1,3)=2+1=3。 在介绍最大流问题之前,先介绍几个概念:残余网络,增广路径,反向弧,最大流定理以及求最大流的Ford-F... 阅读全文
posted @ 2012-08-16 22:47 Suhx 阅读(364) 评论(0) 推荐(0) 编辑
摘要: Crixalis's EquipmentTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1429Accepted Submission(s): 583Problem DescriptionCrixalis - Sand King used to be a giant scorpion(蝎子) in the deserts of Kalimdor. Though he's a guardian of Lich King now, 阅读全文
posted @ 2012-08-15 20:21 Suhx 阅读(409) 评论(0) 推荐(0) 编辑
摘要: Virtual FriendsTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1629Accepted Submission(s): 472Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people,. 阅读全文
posted @ 2012-08-15 20:13 Suhx 阅读(1273) 评论(1) 推荐(1) 编辑
摘要: 二分图最大匹配问题之匈牙利算法一:匈牙利算法的原理:从当前的匹配M(如果木有匹配,则取初始化匹配M为空集)出发,检查每一个未盖点,然后从它出发寻找可增广路,找到可增广路,则沿着这条可增广路进行扩充,直到不存在可增广路为止。二:根据从未盖点出发寻找可增广路搜索的方法,可以分成:1.DFS增广2.BFS增广3.多增广(Hopcroft-Karp算法)采用DFS思想搜索可增广路并求出最大匹配的代码如下:#define MAX 101//MAX为表示X集合和Y集合顶点个数最大值的符号常量int vis[MAX] ;//记录顶点访问状态的数组,为1时表示已经访问过,为0时表示未被访问过int nx,ny 阅读全文
posted @ 2012-08-14 22:44 Suhx 阅读(679) 评论(0) 推荐(0) 编辑
摘要: 非常经典的字典树问题 统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 10514Accepted Submission(s): 4328Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师 阅读全文
posted @ 2012-08-14 22:10 Suhx 阅读(277) 评论(0) 推荐(0) 编辑
摘要: Flow ProblemTime Limit: 5000/5000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3301Accepted Submission(s): 1552Problem DescriptionNetwork flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted dir. 阅读全文
posted @ 2012-08-14 21:09 Suhx 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 最大流的三种模板以HDU 1532 Drainage Ditches为例 Drainage DitchesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4501Accepted Submission(s): 2099Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover 阅读全文
posted @ 2012-08-14 20:47 Suhx 阅读(177) 评论(0) 推荐(0) 编辑