HDU-1849 Rabbit and Grass

Rabbit and Grass(HDU-1849) 题面 大学时光是浪漫的,女生是浪漫的,圣诞更是浪漫的,但是Rabbit和Grass这两个大学女生在今年的圣诞节却表现得一点都不浪漫:不去逛商场,不去逛公园,不去和AC男约会,两个人竟然猫在寝食下棋…… 说是下棋,其实只是一个简单的小游戏而已,游戏的规则是这样的: 1、棋盘包含1*n个方格,方格从左到右分别编号为0,1,2,…,n-1; 2、m个棋子放在棋盘的方格上,方格可以为空,也可以放多于一个的棋子; 3、双方轮流走棋; 4、每一步可以选择任意一个棋子向左移动到任意的位置(可以多个棋子位于同一个方格),当然,任何棋子不能超出棋盘边界; 5、如果所有的棋子都位于最左边(即编号为0的位置),则游戏结束,并且规定最后走棋的一方为胜者。 ...

2020-07-11 · Lordash

HDU-1805 Being a Good Boy in Spring Festival

Being a Good Boy in Spring Festival(HDU-1805) 题面 一年在外 父母时刻牵挂 春节回家 你能做几天好孩子吗 寒假里尝试做做下面的事情吧 陪妈妈逛一次菜场 悄悄给爸爸买个小礼物 主动地 强烈地 要求洗一次碗 某一天早起 给爸妈用心地做回早餐 ...

2020-07-11 · Lordash

HDU-2147 kiki's game

kiki’s game(HDU-2147) 题面 Recently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin is placed in the top right corner(1,m). Each time one people can move the coin into the left, the underneath or the left-underneath blank space.The person who can’t make a move will lose the game. kiki plays it with ZZ.The game always starts with kiki. If both play perfectly, who will win the game? ...

2020-07-11 · Lordash

HDU-2149 Public Sale

Public Sale(HDU-2149) 题面 虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金。现在等待他的,就是像FarmJohn一样的农田生涯。 ...

2020-07-11 · Lordash

POJ-2505 A multiplication game

A multiplication game(POJ-2505) 题面 Stan and Ollie play the game of multiplication by multiplying an integer p by one of the numbers 2 to 9. Stan always starts with p = 1, does his multiplication, then Ollie multiplies the number, then Stan and so on. Before a game starts, they draw an integer 1 < n < 4294967295 and the winner is who first reaches p >= n. 输入 Each line of input contains one integer number n. ...

2020-07-09 · Lordash

POJ-2484 A Funny Game

A Funny Game(POJ-2484) 题面 Alice and Bob decide to play a funny game. At the beginning of the game they pick n(1 <= n <= 106) coins in a circle, as Figure 1 shows. A move consists in removing one or two adjacent coins, leaving all other coins untouched. At least one coin must be removed. Players alternate moves with Alice starting. The player that removes the last coin wins. (The last player to move wins. If you can’t move, you lose.) Note: For n > 3, we use c1, c2, …, cn to denote the coins clockwise and if Alice remove c2, then c1 and c3 are NOT adjacent! (Because there is an empty place between c1 and c3.) ...

2020-07-09 · Lordash

POJ-2234 Matches Game

Matches Game(POJ-2234) 题面 Here is a simple game. In this game, there are several piles of matches and two players. The two player play in turn. In each turn, one can choose a pile and take away arbitrary number of matches from the pile (Of course the number of matches, which is taken away, cannot be zero and cannot be larger than the number of matches in the chosen pile). If after a player’s turn, there is no match left, the player is the winner. Suppose that the two players are all very clear. Your job is to tell whether the player who plays first can win the game or not. ...

2020-07-09 · Lordash

HDU-1527 取石子游戏

取石子游戏(HDU-1527) 题面 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。 ...

2020-07-09 · Lordash

POJ-1067 取石子游戏

取石子游戏(POJ-1067) 题面 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。 ...

2020-07-09 · Lordash

Fibonacci博弈

Fibonacci博弈 基本的斐波那契博弈(Fibonacci Game)描述如下: 有一堆数量多于一的物品,两人轮流取走物品,第一次至少取一个,但不能取完,从第二次开始每个人最少取一个,最多取对手上次取的两倍。 ...

2020-06-18 · Lordash

Wythoff博弈

Wythoff博弈 基本的威佐夫博弈(Wythoff Game)描述如下: 有两堆各若干个物品,两个人轮流从某一堆或同时从两堆中取同样多的物品,每次至少取一个,多者不限,最后取光者得胜。 ...

2020-06-17 · Lordash

Bash博弈

Bash博奕 基本的巴什博弈(Bash Game)描述如下: 有一堆n个物品,两人轮流取走物品,每次至少取一个,最多取m个,最后取光者获胜。 博弈过程如下: 如果n<m,那么先手可以一次取完。先手必胜。 ...

2020-06-15 · Lordash

Nim博弈

Nim博弈 基本的尼姆博弈(Nim Game)描述如下: 有若干堆各若干个物品,两个人轮流从某一堆取任意多的物品,每次至少取一个,多者不限,最后取光者得胜。 博弈过程如下: ...

2020-06-14 · Lordash

SG函数

公平组合游戏 公平组合游戏(Impartial Combinatorial Games)简称ICG,大致定义如下: 游戏有2名选手 对于游戏任何一种可能的局面(position),合法的操作集合只取决于这个局面本身 选手轮流操作(move),且只能在合法操作集合中选择 在游戏出于某状态,当前选手合法操作集合为空时判负,游戏结束 查看解析 一个公平游戏可以抽象地用一个有向无环图来表示,这个图中每个点都对应一个状态,每条有向边代表从一个状态到另一个状态的合法操作。 ...

2020-06-08 · Lordash