英语翻译之3

Split Game

 1000ms  131072K

描述:

Alice and Bob like to cut paper, but they only have one piece of new paper. Both of them want to use this one, but no one wants to split the new paper. Therefore, Alice and Bob decide to fight…in a game.

Alice find an old rectangular paper that consists of N*M grids. Two players take turns and Alice goes first. In each round of action, the player chooses a piece of paper and splits it horizontally or vertically along the grid line. If one player splits out a piece of paper with a single grid, he or she will lose the game. Alice and Bob are smart, and both of them want to win the game. Now you know the size of paper, please predict who will win.

输入:

Each line contains two integer numbers NN and MM, Process to end of file. (1<=N,M<=150,N∗M>1)(1<=N,M<=150,N∗M>1)

输出:

For each case, output the name of the winner.

样例输入:

1 2
1 6
4 3
3 5

样例输出:

Bob
Alice
Alice
Bob

In test case 1: No matter how Alice operates, she will cut out a 1*1 piece of paper. In test case 2: Alice split the paper along the vertical line between grid (1,3) and grid (1,4) at her first turn. In test case 3: At first, Alice split the paper along the horizontal line between grid (2,1) and grid (3,1), then there are two 2*3 papers. Then Alice can copy Bob’s actions. In test case 4: Alice can’t win. The number of test cases is no more than 22499.

1月19:

描述:

爱丽丝和鲍勃喜欢剪纸游戏,但是他们只有一张新纸。他们两人都想使用这张纸,但是没有人想要撕破这张纸,因此,爱丽丝和鲍勃想要在游戏中一决胜负。

爱丽丝找到了一张有着N*M个网格的旧的长方形纸,两位玩家轮流上场,爱丽丝先上场,在每一轮的动作中,玩家选择一张纸,并沿网格线水平或垂直分割。如果一个玩家用一个格子把一张纸撕开,就将输掉比赛。爱丽丝和鲍勃两人都很聪明,他们都想赢得这场比赛。现在你知道纸的大小了,请预测谁会赢。

输入:

每一行包括两个整数N和M,直到进行到文件结尾。(1<=N,M<=150,N*M>1)

输出:

对于每一结果,输出胜利者的名字

样例输入:

1 2

1 6

4 3

3 5

样例输出:

Bob

Alice

Alice

Bob

在测试用例1中:无论爱丽丝怎样操作,她都会剪下一张1*1的纸。

在测试用例2中:爱丽丝在第一次转动时沿着网格(1,3)和网格(1,4)之间的垂直线拆分纸张。

在测试用例3中:首先,爱丽丝沿着网格(2,1)和网格(3,1)之间的水平线分割纸张,然后有两张2*3的纸张。然后爱丽丝可以模仿鲍勃的动作。

在测试用例4中:爱丽丝不会赢。测试用例的数量不超过22499个。

版权声明:本文为博主作者:zyrxbzz原创文章,版权归属原作者,如果侵权,请联系我们删除!

原文链接:https://blog.csdn.net/zyrxbzz/article/details/122592344

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
社会演员多的头像社会演员多普通用户
上一篇 2024年1月16日
下一篇 2024年1月16日

相关推荐