随笔分类 -  数学,二分,素数

摘要:PacketsTime Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always 阅读全文
posted @ 2013-04-22 13:54 Jack Ge 阅读(4027) 评论(1) 推荐(0) 编辑
摘要:DividingTime Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marble 阅读全文
posted @ 2013-04-22 13:29 Jack Ge 阅读(450) 评论(0) 推荐(0) 编辑
摘要:Counterfeit DollarTime Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 2 Accepted Submission(s) : 1Problem DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit eve 阅读全文
posted @ 2013-04-22 12:39 Jack Ge 阅读(386) 评论(0) 推荐(0) 编辑
摘要:JosephTime Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 0 Accepted Submission(s) : 0Problem DescriptionThe Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., 阅读全文
posted @ 2013-04-22 11:17 Jack Ge 阅读(1591) 评论(0) 推荐(0) 编辑
摘要:取石子游戏Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。 阅读全文
posted @ 2013-04-22 10:10 Jack Ge 阅读(8499) 评论(3) 推荐(0) 编辑
摘要:青蛙的约会Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 2 Accepted Submission(s) : 2Problem Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰 阅读全文
posted @ 2013-04-22 09:40 Jack Ge 阅读(7470) 评论(0) 推荐(1) 编辑
摘要:Strange fuctionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1840Accepted Submission(s): 1364Problem DescriptionNow, here is a fuction:F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 阅读全文
posted @ 2013-04-18 23:33 Jack Ge 阅读(901) 评论(0) 推荐(0) 编辑
摘要:CupTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2356Accepted Submission(s): 741Problem DescriptionThe WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height?Th 阅读全文
posted @ 2013-04-18 23:12 Jack Ge 阅读(557) 评论(0) 推荐(0) 编辑
摘要:Can you solve this equation?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4814Accepted Submission(s): 2247Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try yo 阅读全文
posted @ 2013-04-18 22:22 Jack Ge 阅读(489) 评论(0) 推荐(0) 编辑
摘要:1493: 平面划分http://www.acmore.net/problem.php?id=1493Time Limit:1 SecMemory Limit:128 MBSubmit:139Solved:32SubmitStatusWeb BoardDescription一条直线能够将平面分成2部分,两条直线能够将平面分成4部分,而对于一条“V”型线而言,平面被分成2部分,两条“V”型线最多能够将平面分成7部分。对于椭圆封闭曲线对平面的划分又将不一样,任意两个椭圆至多有两个交点。现在给定一个N,你能够计算出三种不同情况下,空间最多被划分出多少个部分吗?Input若干组测试数据,每组测试数据占 阅读全文
posted @ 2013-04-13 21:50 Jack Ge 阅读(360) 评论(0) 推荐(0) 编辑
摘要:1492: 费马定理http://www.acmore.net/problem.php?id=1492Time Limit:1 SecMemory Limit:128 MBSubmit:82Solved:14SubmitStatusWeb BoardDescription以数学家命名的定理有很多,其中费马定理就是其中之一,费马定理表明如果一个素数p不能整除整数a那么a^(p-1)%p=1恒成立。试验可知p-1并不一定是该式成立的最小指数,那么你能找出最小的指数x满足a^x%p=1吗?Input若干组测试数据,每组数据占一行共两个整数a(1#include#include#includeusin 阅读全文
posted @ 2013-04-13 21:01 Jack Ge 阅读(408) 评论(0) 推荐(0) 编辑
摘要:1494: 连续子串和续http://www.acmore.net/problem.php?id=1494Time Limit:10 SecMemory Limit:128 MBSubmit:99Solved:18SubmitStatusWeb BoardDescription小Y要去参加一场笔试,这场笔试有N道题目,每道题目有不同的分值和难度,分别为ai和bi。小Y想知道从某一题开始,至少连续K道题目,分值的和与难度的和的比率最大是多少?Input若干组测试数据,每组测试数据占3行。第一行输出两个正整数N(1<=N<=10^6),K(1<=K<=N)。第二行N个正整数 阅读全文
posted @ 2013-04-13 20:31 Jack Ge 阅读(386) 评论(0) 推荐(0) 编辑
摘要:Number SequenceTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 63Accepted Submission(s): 28Problem DescriptionGiven a number sequence b1,b2…bn.Please count how many number sequences a1,a2,...,ansatisfy the condition that a1*a2*...*an=b1*b2*…*bn(a 阅读全文
posted @ 2013-04-11 13:07 Jack Ge 阅读(469) 评论(0) 推荐(0) 编辑
摘要:How many integers can you findTime Limit: 12000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2767Accepted Submission(s): 778 Problem DescriptionNow you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they 阅读全文
posted @ 2013-04-03 08:08 Jack Ge 阅读(2306) 评论(0) 推荐(0) 编辑
摘要:Co-primeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 626Accepted Submission(s): 234 Problem DescriptionGiven a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two integers are s 阅读全文
posted @ 2013-04-02 12:22 Jack Ge 阅读(1859) 评论(1) 推荐(1) 编辑
摘要:Eddy's爱好Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 900Accepted Submission(s): 397 Problem DescriptionIgnatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣。 这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1。 正当他再度沉迷的时候,他发现不知道什么时候才能知 阅读全文
posted @ 2013-04-02 11:16 Jack Ge 阅读(1486) 评论(2) 推荐(0) 编辑
摘要:The Last Non-zero DigitTime Limit:1000MSMemory Limit:65536KTotal Submissions:4259Accepted:1205DescriptionIn this problem you will be given two decimal integer number N, M. You will have to find the last non-zero digit of theNPM.This means no of permutations of N things taking M at a time.InputThe in 阅读全文
posted @ 2013-03-30 18:25 Jack Ge 阅读(664) 评论(0) 推荐(0) 编辑
摘要:Goldbach's ConjectureTime Limit:1000MSMemory Limit:65536KTotal Submissions:9192Accepted:5357DescriptionFor any even number n greater than or equal to 4, there exists at least one pair of prime numbersp1andp2such thatn=p1+p2This conjecture has not been proved nor refused yet. No one is sure wheth 阅读全文
posted @ 2013-03-23 21:17 Jack Ge 阅读(265) 评论(0) 推荐(0) 编辑
摘要:Number SequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 930 Accepted Submission(s): 367Problem 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 c 阅读全文
posted @ 2013-03-17 13:37 Jack Ge 阅读(316) 评论(0) 推荐(0) 编辑
摘要:5: DecomposeResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K318182StandardGive you an positive integer N(1<=N<=30), you can decompose n to several positive integers: A1, A2, ... Ak. (1<=k<=N) And A1 + A2 + ... + Ak = N. Now i want to know what's the maximal product of these 阅读全文
posted @ 2013-03-17 10:02 Jack Ge 阅读(285) 评论(0) 推荐(0) 编辑