l********r 发帖数: 11 | 1 Two people play a game. In turn, each player says a number between 1 and
10 (inclusive). The accumulative score is recorded. The aim of the game is
force your opponent to make the total equal to or above 60. As the player
going first, what strategy should you adopt to enable you to guarantee a
victory? |
x***y 发帖数: 633 | 2 a variation of NIM. L: losing, W: winning
You only need to move your opponent to the losing position.
1 is losing
2-11 are winning
12 losing
13-22 winning
23 losing
24-33 winning
34 losing
35-44 winning
45 losing
46-55 winning
56 losing
57-60 winning |
s*****t 发帖数: 737 | 3 I think you can think in a reverse way.
You are guaranteed to win, if you get chance to make the total number to 59
You are guaranteed to make the total number to 59, if you get chance to make
the second to last total number to 48, and so on, 37, 26, 15, 4.
So in order to win, you need to be the first guy to say 4.
correct me if I'm wrong
【在 l********r 的大作中提到】 : Two people play a game. In turn, each player says a number between 1 and : 10 (inclusive). The accumulative score is recorded. The aim of the game is : force your opponent to make the total equal to or above 60. As the player : going first, what strategy should you adopt to enable you to guarantee a : victory?
|
s*****t 发帖数: 737 | 4 I didn't get it. What is NIM? Why 56 is a losing position?
a variation of NIM. L: losing, W: winning
You only need to move your opponent to the losing position.
1 is losing
2-11 are winning
12 losing
13-22 winning
23 losing
24-33 winning
34 losing
35-44 winning
45 losing
46-55 winning
56 losing
57-60 winning
【在 x***y 的大作中提到】 : a variation of NIM. L: losing, W: winning : You only need to move your opponent to the losing position. : 1 is losing : 2-11 are winning : 12 losing : 13-22 winning : 23 losing : 24-33 winning : 34 losing : 35-44 winning
|
B*****t 发帖数: 335 | 5 should go for 4 first
between 1 and
the game is
the player
guarantee a
【在 l********r 的大作中提到】 : Two people play a game. In turn, each player says a number between 1 and : 10 (inclusive). The accumulative score is recorded. The aim of the game is : force your opponent to make the total equal to or above 60. As the player : going first, what strategy should you adopt to enable you to guarantee a : victory?
|
c****w 发帖数: 565 | 6 哈哈,记得小时候老爸和我玩的游戏,指定一个数字为目标。我俩一人说一个数字,从
1开始,每个数字是上一个人的数字加上1-3之间的数,嘿嘿,竟然面试也有这种题目。
这题就是看谁先说到59,看错,包含10,一共11个数字,算算59除以11的余数吧,然后每次都要说到这个余数加11n,over. |
i***1 发帖数: 95 | 7 if the player go first, and he play optimally, I will lose.
The secret is that whatever the number one player pick (say a), the other
player can pick a corresponding number (b = 11-a)
so the player who pick first should pick 4. After that, keep going like what
mentioned above, and will reach 59. |
p*******o 发帖数: 6791 | 8
59
make
second this, this is exactly what i would do.
【在 s*****t 的大作中提到】 : I think you can think in a reverse way. : You are guaranteed to win, if you get chance to make the total number to 59 : You are guaranteed to make the total number to 59, if you get chance to make : the second to last total number to 48, and so on, 37, 26, 15, 4. : So in order to win, you need to be the first guy to say 4. : correct me if I'm wrong
|
x*****p 发帖数: 1707 | 9 The first player say 4 first, then no matter what the second play selects,
the first player always add it to 11.
Then the first player will add numbers to sum to following numbers.
4
15
26
37
48
59
Win! |
x*****p 发帖数: 1707 | 10 The first player say 4 first, then no matter what the second play selects,
the first player always add it to 11.
Then the first player will add numbers to sum to following numbers.
4
15
26
37
48
59
Win! |