上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: break point 在 边数很少,o(n*m)暴力出奇迹~~~#include#include#include#include#include#include#includeusing namespace std;const int maxn = 1005, maxm = 22222, inf=... 阅读全文
posted @ 2014-06-07 17:47 Ramanujan 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Bridging signalsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 10212Accepted: 5589Description'Oh no, they'... 阅读全文
posted @ 2014-06-03 22:33 Ramanujan 阅读(278) 评论(1) 推荐(0) 编辑
摘要: 这个题和kmp算法的共同点,也就是可以用kmp解的原因,在于当前缀所在串(kmp中的模式串)字符pj≠后缀所在串(kmp中文本串)字符tj时,应使前缀串(kmp中模式串)尽量往右移动最大位移,而暴力算法则是每次移动位移为1。#include#include#include#includeusing ... 阅读全文
posted @ 2014-05-19 21:30 Ramanujan 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Rightmost DigitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29108Accepted Submission(s): 11115Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line 阅读全文
posted @ 2014-03-07 22:42 Ramanujan 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 数塔Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18918Accepted Submission(s): 11276Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是 阅读全文
posted @ 2014-03-07 22:04 Ramanujan 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Integer InquiryTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10588Accepted Submission(s): 2737Problem DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 阅读全文
posted @ 2014-03-07 00:03 Ramanujan 阅读(286) 评论(0) 推荐(0) 编辑
摘要: Catch That CowTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 41703Accepted: 13005DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100 阅读全文
posted @ 2014-03-05 16:52 Ramanujan 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 六度分离Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3562Accepted Submission(s): 1412Problem Description1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degre 阅读全文
posted @ 2014-03-05 16:13 Ramanujan 阅读(238) 评论(0) 推荐(0) 编辑
摘要: Number SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 93488Accepted Submission(s): 22297Problem 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 @ 2014-03-05 15:10 Ramanujan 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Let the Balloon RiseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 65716Accepted Submission(s): 24329Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time 阅读全文
posted @ 2014-03-05 14:31 Ramanujan 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页