2011年7月26日

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 阅读(4483) 评论(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 阅读(274) 评论(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 阅读(293) 评论(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 阅读(13533) 评论(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 阅读(2073) 评论(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 阅读(439) 评论(0) 推荐(1) 编辑

2011年7月25日

有向图的强连通分量

摘要: 最关键通用部分:强连通分量一定是图的深搜树的一个子树。一、 Kosaraju算法1. 算法思路基本思路:这个算法可以说是最容易理解,最通用的算法,其比较关键的部分是同时应用了原图G和反图GT。(步骤1)先用对原图G进行深搜形成森林(树),(步骤2)然后任选一棵树对其进行深搜(注意这次深搜节点A能往子节点B走的要求是EAB存在于反图GT),能遍历到的顶点就是一个强连通分量。余下部分和原来的森林一起组成一个新的森林,继续步骤2直到 没有顶点为止。改进思路:当然,基本思路实现起来是比较麻烦的(因为步骤2每次对一棵树进行深搜时,可能深搜到其他树上去,这是不允许的,强连通分量只能存在单棵树中(由开篇第一 阅读全文

posted @ 2011-07-25 22:51 kuangbin 阅读(2259) 评论(0) 推荐(1) 编辑

ACM HDU 1385Minimum Transport Cost

摘要: Minimum Transport CostTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2369Accepted Submission(s): 584Problem DescriptionThese are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is so 阅读全文

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

ZOJ Problem Set - 1003Crashing Balloon

摘要: Crashing BalloonTime Limit: 1 Second Memory Limit: 32768 KBOn every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 labeled balloons, with the numbers 1 to 100. After the referee shouts "Let 阅读全文

posted @ 2011-07-25 22:03 kuangbin 阅读(902) 评论(1) 推荐(1) 编辑

导航

JAVASCRIPT: