随笔分类 -  博弈

Stone Game
摘要:Stone GameTime Limit:1000MSMemory Limit:65535KBSubmissions:1Accepted:1DescriptionAC and WA love to collect stones and play games with them. Up till now they have collected Na white stones and Nb black stones, and they are going to play a new game. The rules of the game is as follows: (1) All the sto 阅读全文

posted @ 2013-01-30 15:21 即为将军 阅读(364) 评论(0) 推荐(0)

A New Stone Game
摘要:A New Stone GameTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 4177Accepted: 2227DescriptionAlice and Bob decide to play a new stone game.At the beginning of the game they pick n(1<=n<=10) piles of stones in a line. Alice and Bob move the stones in turn. At each step of the game,the 阅读全文

posted @ 2012-11-17 00:20 即为将军 阅读(235) 评论(0) 推荐(0)

Queer Game
摘要:Queer Game描述Caspar is queer boy. One day, his queer girlfriend Rapsac queerly asks him to play a queer game with her. This game called “queer game”. Suppose that there are N queer stones. Caspar and Rapsac pick up some (at least 1 while at most K) of them successively. And if there is no stone in so 阅读全文

posted @ 2012-11-14 09:48 即为将军 阅读(241) 评论(0) 推荐(0)

Game
摘要:GameDescriptionOne day, Caspar’s girlfriend Rapsac asked Caspar to play a game with her. This game called “The Trains”. There are some cards, each of them is marked with an integer K (1<=K<=200). Before the beginning of the game, they divide them to 2 sequences, one for Caspar and another for 阅读全文

posted @ 2012-11-14 09:46 即为将军 阅读(300) 评论(0) 推荐(0)

Game
摘要:GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 710Accepted Submission(s): 236Problem DescriptionAlice and Bob are playing game with each other. They play the game on a 2D board. Alice has many vertical 1*2 tiles while Bob has many horizontal 2 阅读全文

posted @ 2012-11-09 21:02 即为将军 阅读(352) 评论(0) 推荐(0)

邂逅明下
摘要:邂逅明下Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1108Accepted Submission(s): 530Problem Description当日遇到月,于是有了明。当我遇到了你,便成了侣。那天,日月相会,我见到了你。而且,大地失去了光辉,你我是否成侣?这注定是个凄美的故事。(以上是废话)小t和所有世俗的人们一样,期待那百年难遇的日食。驻足街头看天,看日月渐渐走近,小t的脖子那个酸呀(他坚持这个姿势已经有半个多小时啦)。他低下仰起 阅读全文

posted @ 2012-11-09 11:32 即为将军 阅读(219) 评论(0) 推荐(0)

A Multiplication Game
摘要:A Multiplication GameTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2264Accepted Submission(s): 1300Problem DescriptionStan and Ollie play the game of multiplication by multiplying an integer p by one of the numbers 2 to 9. Stan always starts with 阅读全文

posted @ 2012-11-09 11:29 即为将军 阅读(910) 评论(0) 推荐(0)

分花生游戏
摘要:分花生游戏Description4月6日,我校Nicholas代表队做火车前往湖北武汉大学参加“百度杯”第二届华中北区ACM程序设计邀请赛,在火车上老师和队员们觉得要找点事情来做,于是小谭(谭老师)就抓了一大包花生出来,让大家玩一个分花生的游戏,游戏规则如下:桌子上放着两堆花生,Player1和Player2轮流对这些花生进行操作。在每一次操作中,操作者需要吃掉其中一堆花生,并且把另一堆花生分成两堆(可以不相等)留给对方操作。游戏如此进行下去,花生数会越来越少,最后必将出现这样一种情况:某人吃掉一堆花生后发现另一堆里只剩一颗花生不能再分了。游戏规定此时该操作者吃掉最后这一颗花生从而取胜。起初N 阅读全文

posted @ 2012-11-01 17:11 即为将军 阅读(733) 评论(2) 推荐(0)

尼姆博弈(Nimm's Game)
摘要:尼姆博弈(Nimm's Game)题型尼姆博弈模型,大致上是这样的:有3堆各若干个物品,两个人轮流从某一堆取任意多的物品,规定每次至少取1个,多者不限,最后取光者得胜。分析1、首先自己想一下,就会发现只要最后剩两堆物品一样多(不为零),第三堆为零,那面对这种局势的一方就必败那我们用(a,b,c)表示某种局势,首先(0,0,0)显然是必败态,无论谁面对(0,0,0) ,都必然失败;第二种必败态是(0,n,n),自己在某一堆拿走k(k ≤ n)个物品,不论k为多少,对方只要在另一堆拿走k个物品,最后自己都将面临(0,0,0)的局势,必败。仔细分析一下,(1,2,3)也是必败态,无论自己如何 阅读全文

posted @ 2012-11-01 17:03 即为将军 阅读(15222) 评论(4) 推荐(11)

john的游戏
摘要:john的游戏Descriptionjohn发明了一个好玩的游戏,叫mike一起玩. 这个游戏是这样的,john先写下一排数。既然是一排,当然有首尾咯。 john和mike每次只能从这排数的头或尾取一个数。 最后谁取的数的和多,谁就赢了。如果两人的和一样多,先取者胜。 现在你的任务就是判断在两人总是做出最优决策的情况下(两个人的智商都是很高的……), 谁能取得最终的胜利呢?Input第一行为一个数k(k<=10),表示有k组测试数据。 以下k组测试数据。 每组测试数据中,第一行仅有一个偶数n(0 < n <= 100000 ) 第二行也仅有一个数,1表示john先取数,0表示 阅读全文

posted @ 2012-11-01 16:11 即为将军 阅读(723) 评论(0) 推荐(0)

summer
摘要:summerDescriptionThissummerissohotthatYSYisovercamebytheheatandatthistimenothingcouldbebetterthancoolwater.ShoweringwiththecoolwatermakesYSYsohappy.Buthefeelslonelyandinviteshisfriendtoenjoyit.That'sareallygoodgamewiththefollowingrules:First:Wehavetwobigbucketswhichissobigthatyoucannotfillupit.T 阅读全文

posted @ 2012-10-28 09:17 即为将军 阅读(233) 评论(0) 推荐(0)

Euclid's Game
摘要:Euclid's GameDescriptionTwo players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser of the two numbers from the greater of the two numbers, provided that the resulting number must be nonnegative. Then Ollie, the seco 阅读全文

posted @ 2012-10-27 21:00 即为将军 阅读(904) 评论(0) 推荐(0)

最简单的巴什博弈
摘要:巴什博弈所谓巴什博弈,是ACM题中最简单的组合游戏,大致上是这样的:只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取1个,最多取m个,最后取光者得胜。分析: 显然,如果n = m + 1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了如何取胜的法则:如果 n = (m + 1) * r + s ,(r为任意自然数,s≤m),即n%(m+1) != 0,则先取者肯定获胜。 每一局,你都必须构建一个局势,这个局势就是每次都留给对手m+1的倍数个物品。因为,如果n=(m+1)r + s,(r为任意自然数,s≤m),那么先取 阅读全文

posted @ 2012-10-27 13:02 即为将军 阅读(1041) 评论(0) 推荐(0)

取石子游戏
摘要:取石子游戏Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 29247Accepted: 9575Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子的数目,a和b都不大于 阅读全文

posted @ 2012-10-25 22:27 即为将军 阅读(9470) 评论(1) 推荐(5)

导航