
ACM/博弈
文章平均质量分 78
Magic_____
当神已无能为力便由魔来普度众生
展开
-
博弈入门
巴什博奕(Bash Game)只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个。最后取光者得胜。 显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了如何取胜的法则:如果n=(m+1)r+s,(r为任意自然数,s≤m),那么先取者要拿走s个物品,如果后取者拿走k(≤m)个,那么转载 2013-07-13 18:34:13 · 872 阅读 · 0 评论 -
Hdu 1729 Stone Game
Stone GameTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Problem DescriptionThis game is a two-player game and is played as follows:1. There are n原创 2013-07-18 09:47:34 · 767 阅读 · 0 评论 -
Zoj 3529 A Game Between Alice and Bob
1017#include#includeint SG[5100000];int num[110000];void fun(){ __int64 i,j,tmp; for(i=2;i<=5000000;i++) { if(SG[i]==0) { for(j=i;j<=5000000;j+=i) { tmp=j; while(!原创 2013-07-18 14:46:50 · 1245 阅读 · 0 评论 -
Hdu 1536 S-Nim
S-NimTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/OthersProblem DescriptionArthur and his sister Caroll have been playing a game called Nim for some time now原创 2013-07-17 19:29:07 · 805 阅读 · 0 评论 -
Hdu 1907 John
JohnTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Problem DescriptionLittle John is playing very funny game with his younger brother. There is one big原创 2013-07-17 17:59:39 · 973 阅读 · 0 评论 -
Hdu 1730 Northcott Game
Northcott GameTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description Tom和Jerry正在玩一种Northcott游戏,可是Tom老是输,因此他怀疑这个游戏是不是有某种必胜策略,郁闷的Tom现在向你求救了,你原创 2013-07-17 15:17:08 · 954 阅读 · 0 评论 -
Hdu 1404 Digital Deletions
Digital DeletionsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionDigital deletions is a two-player game. The rule of the game is as fo原创 2013-07-17 11:12:02 · 1012 阅读 · 0 评论 -
Hdu 1760 A New Tetris Game
A New Tetris GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description曾经,Lele和他姐姐最喜欢,玩得最久的游戏就是俄罗斯方块(Tetris)了。渐渐得,Lele发觉,玩这个游戏只需要手快而已,几乎不用原创 2013-07-17 11:37:59 · 959 阅读 · 0 评论 -
Hdu 1079 Calendar Game
Problem DescriptionAdam and Eve enter this year’s ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this contest. This game consists of t原创 2013-07-15 08:51:36 · 1037 阅读 · 0 评论 -
Hdu 1517 A Multiplication Game
A Multiplication GameTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2717 Accepted Submission(s): 1553Problem DescriptionStan and原创 2013-07-14 13:17:49 · 749 阅读 · 0 评论 -
Hdu 1850 Being a Good Boy in Spring Festival
Problem Description一年在外 父母时刻牵挂春节回家 你能做几天好孩子吗寒假里尝试做做下面的事情吧陪妈妈逛一次菜场悄悄给爸爸买个小礼物主动地 强烈地 要求洗一次碗某一天早起 给爸妈用心地做回早餐如果愿意 你还可以和爸妈说咱们玩个小游戏吧 ACM课上学的呢~下面是一个二人小游戏:桌子上有M堆扑克牌;每堆牌的数量分别为Ni(i=1…M原创 2013-07-13 19:00:09 · 722 阅读 · 0 评论 -
博弈总结
博弈题总的思路是:步骤1:将所有终结位置标记为必败点(P点);步骤2: 将所有一步操作能进入必败点(P点)的位置标记为必胜点(N点)步骤3:如果从某个点开始的所有一步操作都只能进入必胜点(N点) ,则将该点标记为必败点(P点) ;步骤4: 如果在步骤3未能找到新的必败(P点),则算法终止;否则,返回到步骤2。一般的简单题通过分析出简单数据的答案找出规律。规律原创 2013-07-19 22:37:16 · 807 阅读 · 0 评论