摘要: I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18466Accepted Submission(s): 7172Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每. 阅读全文
posted @ 2012-08-27 22:20 Suhx 阅读(4249) 评论(0) 推荐(0) 编辑
摘要: A strange liftTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6706Accepted Submission(s): 2499Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.T 阅读全文
posted @ 2012-08-27 21:49 Suhx 阅读(2126) 评论(1) 推荐(0) 编辑
摘要: N!Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34687Accepted Submission(s): 9711Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N, output N! in. 阅读全文
posted @ 2012-08-27 21:25 Suhx 阅读(6764) 评论(0) 推荐(1) 编辑
摘要: How many prime numbersTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7120Accepted Submission(s): 2375Problem DescriptionGive you a lot of positive integers, just to find out how many prime numbers there are.InputThere are a lot of cases. In each . 阅读全文
posted @ 2012-08-27 20:57 Suhx 阅读(2799) 评论(0) 推荐(1) 编辑
摘要: 取石子游戏Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2039Accepted Submission(s): 965Problem Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还. 阅读全文
posted @ 2012-08-26 22:12 Suhx 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 取石子游戏Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1415Accepted Submission(s): 798Problem Description1堆石子有n个,两人轮流取.先取者第1次可以取任意多个,但不能全部取完.以后每次取的石子数不能超过上次取子数的2倍。取完者胜.先取者负输出"Second win".先取者胜输出"First win".Input输入有多组.每组第1行是2<=n& 阅读全文
posted @ 2012-08-26 21:08 Suhx 阅读(2821) 评论(1) 推荐(1) 编辑
摘要: (转)取石子问题综述有一种很有意思的游戏,就是有物体若干堆,两个人轮流从堆中取物体若干,规定最后取光物体者取胜。这是我国民间很古老的一个游戏,这游戏虽极其简单,却蕴含着深刻的数学原理。(一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个。最后取光者得胜。 显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了如何取胜的法则:如果n=(m+1)r+s,(r为任意自然数,s≤m),那么先取者要拿走s个物品,如果后取者拿走k(≤m)个,那么先取者再拿走m+1- 阅读全文
posted @ 2012-08-26 20:57 Suhx 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 素数回文Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6234Accepted Submission(s): 1421Problem Descriptionxiaoou33对既是素数又是回文的数特别感兴趣。比如说151既是素数又是个回文。现在xiaoou333想要你帮助他找出某个范围内的素数回文数,请你写个程序找出 a 跟b 之间满足条件的数。(5 <= a < b <= 100,000,000); Input这里有许多组数 阅读全文
posted @ 2012-08-26 16:34 Suhx 阅读(4974) 评论(0) 推荐(0) 编辑
摘要: 奇数阶魔方Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1283Accepted Submission(s): 716Problem Description一个 n 阶方阵的元素是1,2,...,n^2,它的每行,每列和2条对角线上元素的和相等,这样的方阵叫魔方。n为奇数时我们有1种构造方法,叫做“右上方” ,例如下面给出n=3,5,7时的魔方.38 1 63 5 74 9 2517 24 1 8 1523 5 7 14 164 6 13 . 阅读全文
posted @ 2012-08-24 21:44 Suhx 阅读(524) 评论(1) 推荐(0) 编辑
摘要: Largest prime factorTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4026Accepted Submission(s): 1415Problem DescriptionEverybody knows any number can be combined by the prime number.Now, your task is telling me what position of the largest prime f. 阅读全文
posted @ 2012-08-24 21:05 Suhx 阅读(2100) 评论(0) 推荐(1) 编辑