avatar
l*r
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?
avatar
x*y
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
avatar
s*t
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?

avatar
s*t
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

avatar
B*t
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?

avatar
c*w
6
哈哈,记得小时候老爸和我玩的游戏,指定一个数字为目标。我俩一人说一个数字,从
1开始,每个数字是上一个人的数字加上1-3之间的数,嘿嘿,竟然面试也有这种题目。
这题就是看谁先说到59,看错,包含10,一共11个数字,算算59除以11的余数吧,然后每次都要说到这个余数加11n,over.
avatar
i*1
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.
avatar
p*o
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

avatar
x*p
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!
avatar
x*p
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!
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。