2011年7月26日

最大流问题

摘要: 最近又复习了下最大流问题,每次看这部分的内容都会有新的收获。可以说最大流问题的资料网上一搜一大把,根本没有必要自己写;但是大部分资料上的专业术语太多了,初学很难理解,至少我当年学这部分的时候前几次就没有看懂。所以我准备备份一点个人的理解。图-1 如图-1所示,在这个运输网络中,源点S和汇点T分别是1,7,各边的容量为C(u,v)。图中红色虚线所示就是一个可行流。标准图示法如图-2所示:其中p(u,v) / c(u,v)分别表示该边的实际流量与最大容量。 关于最大流 熟悉了什么是网络流,最大流也就很好理解了。就是对于任意的u∈V-{s},使得p(s,u)的和达到最大。上面的运输网络中,最大流如图 阅读全文

posted @ 2011-07-26 20:48 kuangbin 阅读(48723) 评论(5) 推荐(5) 编辑

ACM HDU 1005 Number Sequence

摘要: Number SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41179Accepted Submission(s): 8827Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to 阅读全文

posted @ 2011-07-26 16:35 kuangbin 阅读(4482) 评论(3) 推荐(0) 编辑

ACM HDU 1004 Let the Balloon Rise

摘要: Let the Balloon RiseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30662Accepted Submission(s): 10048Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time 阅读全文

posted @ 2011-07-26 15:04 kuangbin 阅读(2597) 评论(2) 推荐(2) 编辑

ACM HDU1001Sum Problem

摘要: Sum ProblemTime Limit: 1000/500 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 113869Accepted Submission(s): 26069Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.In 阅读全文

posted @ 2011-07-26 14:28 kuangbin 阅读(273) 评论(0) 推荐(0) 编辑

ACM HDU1000A + B Problem

摘要: A + B ProblemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 150787Accepted Submission(s): 47736Problem DescriptionCalculate A + B.InputEach line will contain two integers A and B. Process to end of file.OutputFor each case, output A + B in one lin 阅读全文

posted @ 2011-07-26 14:27 kuangbin 阅读(292) 评论(0) 推荐(0) 编辑

HDOJ题目分类

摘要: 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201 1202 1205 1209 1212(大数取模) 1216(链表)1218 1219 1225 1228 阅读全文

posted @ 2011-07-26 14:05 kuangbin 阅读(13522) 评论(0) 推荐(5) 编辑

ACM HDU 1068 Girls and Boys

摘要: Girls and BoysTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3019Accepted Submission(s): 1294Problem Descriptionthe second year of the university somebody started a study on the romantic relations between the students. The relation “romantically 阅读全文

posted @ 2011-07-26 13:58 kuangbin 阅读(2072) 评论(0) 推荐(0) 编辑

【转】 cin、cin.get()、cin.getline()、getline()、gets()等函数的用法

摘要: 学C++的时候,这几个输入函数弄的有点迷糊;这里做个小结,为了自己复习,也希望对后来者能有所帮助,如果有差错的地方还请各位多多指教(本文所有程序均通过VC 6.0运行)转载请保留作者信息;1、cin1、cin.get()2、cin.getline()3、getline()4、gets()5、getchar()1、cin>>用法1:最基本,也是最常用的用法,输入一个数字:#include <iostream>using namespace std;main (){int a,b;cin>>a>>b;cout<<a+b<<en 阅读全文

posted @ 2011-07-26 12:22 kuangbin 阅读(438) 评论(0) 推荐(1) 编辑

导航

JAVASCRIPT: