2012年8月31日

最长公共子序列 poj1458

摘要: Common SubsequenceTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 30423Accepted: 11856DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another sequence Z = < z1, z2, ..., zk > 阅读全文

posted @ 2012-08-31 09:03 yumao 阅读(1281) 评论(0) 推荐(0)

2012年8月30日

vector 可变长数组 hdu 3823

摘要: Problem FTime Limit : 4000/2000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 1Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionBesides the ordinary Boy Friend and Girl Friend, here we define a more academic kind of f 阅读全文

posted @ 2012-08-30 22:26 yumao 阅读(1210) 评论(0) 推荐(0)

2012年8月24日

取多次方的前n位

摘要: K次方Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 23 Accepted Submission(s) : 10Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description所有在程式设计已经有点经验的人都知道,当k很大时你无法完整的表达出n k。例如: C语言的函数 pow(123456,455)能够用double资料型态来表达,但是你却无法得到所有正确的 阅读全文

posted @ 2012-08-24 22:51 yumao 阅读(205) 评论(0) 推荐(0)

2012年8月23日

DP 记忆化搜索 poj 1088

摘要: 滑雪Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 60568Accepted: 22075DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个人可以从某个点滑向... 阅读全文

posted @ 2012-08-23 21:43 yumao 阅读(236) 评论(0) 推荐(0)

USC newweek2 G

摘要: Problem DescriptionFor national security, the coordinate systems of public map service are all in an encryption system. This means that when you got the latitude and longitude coordinates from a GPS device, you cannot finger out the real place at a public map with that coordinates.We know an encrypt 阅读全文

posted @ 2012-08-23 17:29 yumao 阅读(162) 评论(0) 推荐(0)

USC newweek2 H hdu 3335

摘要: Problem DescriptionAs we know,the fzu AekdyCoin is famous of math,especially in the field of number theory.So,many people call him "the descendant of Chen Jingrun",which brings him a good reputation.AekdyCoin also plays an important role in the ACM_DIY group,many people always ask him ques 阅读全文

posted @ 2012-08-23 17:20 yumao 阅读(226) 评论(0) 推荐(0)

2012年8月22日

旋转卡壳

摘要: 该算法一般用于求凸包上两点间的最大距离。方法一: 从任意一个顶点开始,按逆时针方向计算其他每一点到该顶点的距离。使距离为一直是递增的,直到开始递减;然后记录下这一次的最大值。 然后移动为基础的那个点,从上次中断的点开始;再重复上述步骤,直到距离又递减为止。 所有的最大值即是凸包的直径。方法二: 任意取一条边,计算每一个点到该条边的距离,直到距离开始递减;具体和方法一相似。代码实现(凸包的周长,直径:方法二)#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring> 阅读全文

posted @ 2012-08-22 21:24 yumao 阅读(243) 评论(0) 推荐(0)

图 poj 1511

摘要: Invitation CardsTime Limit: 8000MSMemory Limit: 262144KTotal Submissions: 14626Accepted: 4727DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. T 阅读全文

posted @ 2012-08-22 16:46 yumao 阅读(124) 评论(0) 推荐(0)

图 poj 1985

摘要: Cow MarathonTime Limit: 2000MSMemory Limit: 30000KTotal Submissions: 2672Accepted: 1317Case Time Limit: 1000MSDescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. The m 阅读全文

posted @ 2012-08-22 16:25 yumao 阅读(299) 评论(0) 推荐(0)

2012年8月21日

GCD & LCM 一个神奇的式子

摘要: DescriptionGiven x and y (2 <= x <= 100,000, 2 <= y <= 1,000,000), you are to count the number of p and q such that:1) p and q are positive integers;2) GCD(p, q) = x;3) LCM(p, q) = y.Inputx and y, one line for each test.OutputNumber of pairs of p and q.Sample Input3 60Sample Output4这道题的精 阅读全文

posted @ 2012-08-21 22:30 yumao 阅读(2602) 评论(0) 推荐(0)

导航