摘要: 威佐夫博奕 有两堆各若干个物品,两个人轮流从某一堆或同时从两堆中取同样多的物品,规定每次至少取一个,多者不限,最后取光者得胜。 这种情况下是颇为复杂的。我们用(ak,bk)(ak ≤ bk ,k=0,1,2,...,n)表示两堆物品的数量并称其为局势,如果甲面对(0,0),那么甲已经输了,这种局势我们称为奇异局势。前几个奇异局势是: (0,0)、(1,2)、(3,5)、(4,7)、(6,10)、(8,13)、(9,15)、(11,18)、(12,20)。 可以看出,a0=b0=0,ak是未在前面出现过的最小自然数,而 bk= ak + k。奇异局势有如下三条性质: 1。任何自然数都包含... 阅读全文
posted @ 2012-08-17 18:04 3111006139 阅读(174) 评论(0) 推荐(0) 编辑
摘要: (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个。最后取光者得胜。 显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了如何取胜的法则:如果n=(m+1)*r+s,(r为任意自然数,s≤m),那么先取者要拿走s个物品,如果后取者拿走k(≤m)个,那么先取者再拿走m+1-k个,结果剩下(m+1)(r-1)个,以后保持这样的取法,那么先取者肯定获胜。总之,要保持给对手留下(m+1)的倍数,就能最后获胜。 这个游戏还可以有一种变相的玩法:两个人轮流报.. 阅读全文
posted @ 2012-08-17 01:49 3111006139 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Sliding WindowTime Limit: 12000MSMemory Limit: 65536KTotal Submissions: 26564Accepted: 7880Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers 阅读全文
posted @ 2012-08-17 00:46 3111006139 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Space ElevatorTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6236Accepted: 2883DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) different types of blocks with which to build t 阅读全文
posted @ 2012-08-16 23:10 3111006139 阅读(201) 评论(0) 推荐(0) 编辑
摘要: InvestmentTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 5419Accepted: 1874DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only in 阅读全文
posted @ 2012-08-16 22:27 3111006139 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Charm BraceletTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 13771Accepted: 6272DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each charm 阅读全文
posted @ 2012-08-16 22:03 3111006139 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Primitive Roots Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1284DescriptionWe say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 } is equal to { 1, ..., p-1 }. F 阅读全文
posted @ 2012-08-16 18:47 3111006139 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Prime Distance Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2689DescriptionThe branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of ye 阅读全文
posted @ 2012-08-16 18:29 3111006139 阅读(166) 评论(0) 推荐(0) 编辑
摘要: J - Goldbach's Conjecture Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2909DescriptionFor any even number n greater than or equal to 4, there exists at least one pair of prime numbers p1 and p2 such thatn = p1 + p2This conjecture has not bee 阅读全文
posted @ 2012-08-16 14:54 3111006139 阅读(118) 评论(0) 推荐(0) 编辑
摘要: I - Goldbach's Conjecture Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2262DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture: Every even number g 阅读全文
posted @ 2012-08-16 14:47 3111006139 阅读(113) 评论(0) 推荐(0) 编辑