摘要: 排序Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28358 Accepted Submission(s): 7850Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 In... 阅读全文
posted @ 2013-09-22 16:44 heaventouch 阅读(88) 评论(0) 推荐(1) 编辑
摘要: ShoppingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1400 Accepted Submission(s): 456Problem Description Every girl likes shopping,so does dandelion.Now she finds the shop is increasing the price every day because the Spring Festival is ... 阅读全文
posted @ 2013-09-22 16:23 heaventouch 阅读(391) 评论(0) 推荐(1) 编辑
摘要: RelativesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10269 Accepted: 4950DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a 阅读全文
posted @ 2013-09-21 17:52 heaventouch 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Perfect Pth PowersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15918 Accepted: 3605DescriptionWe say that x is a perfect square if, for some integer b, x = b2. Similarly, x is a perfect cube if, for some integer b, x = b3. More generally, x is a perfect pth power if, for some integer b. 阅读全文
posted @ 2013-09-21 09:26 heaventouch 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Goldbach's ConjectureTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 34596 Accepted: 13275DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture: Every even number greater than 4 can be written a 阅读全文
posted @ 2013-09-20 23:31 heaventouch 阅读(156) 评论(0) 推荐(0) 编辑
摘要: OnesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10306 Accepted: 5869DescriptionGiven any integer 0 int main(void){ int n; while(scanf("%d",&n)!=EOF) { int e=1; int cnt=1; while(e!=0){ e=10*e+1; e%=n; cnt++; } pr... 阅读全文
posted @ 2013-09-20 23:17 heaventouch 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13655 Accepted Submission(s): 5938Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14... 阅读全文
posted @ 2013-09-20 12:44 heaventouch 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Common SubsequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18332 Accepted Submission(s): 7742Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a seque... 阅读全文
posted @ 2013-09-20 11:27 heaventouch 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Monkey and BananaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6077 Accepted Submission(s): 3091Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a buil... 阅读全文
posted @ 2013-09-19 18:11 heaventouch 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Largest Rectangle in a HistogramTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8484 Accepted Submission(s): 2366Problem DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles h... 阅读全文
posted @ 2013-09-17 12:07 heaventouch 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13598 Accepted Submission(s): 5433Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.... 阅读全文
posted @ 2013-09-17 07:57 heaventouch 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 最大报销额Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13691 Accepted Submission(s): 3804Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Inp... 阅读全文
posted @ 2013-09-16 22:43 heaventouch 阅读(92) 评论(0) 推荐(0) 编辑
摘要: To the MaxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 37431 Accepted: 19715DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum o. 阅读全文
posted @ 2013-09-16 21:08 heaventouch 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 68987 Accepted: 25450DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个人可以从某个... 阅读全文
posted @ 2013-09-16 20:20 heaventouch 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Knight MovesTimeLimit: 1000MS Memory Limit: 65536KTotal Submissions: 10262 Accepted: 5786DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessbo. 阅读全文
posted @ 2013-09-15 10:28 heaventouch 阅读(125) 评论(0) 推荐(0) 编辑