當前位置:文思屋>學習教育>考研>

Sap的筆試題目

文思屋 人氣:2.09W

and Diamond like playing game of coins,One day they

Sap的筆試題目

designed a new set of rules:

1)Totally 10 coins

2)One can take away 1,2or 4 coins at one time by turns

3)Who takes the last loses.

Given these rules Whether the winning status is pre-determined or not

解答:

1:從後面開始考慮,最後肯定要留1個才能保證自己贏

2:所以要設法讓對方留下2,3,5個

3:也就是要自己取後留下1,4,6,7,8,9。。。

4:如果自己取後留下6,對方取2個,與(3)矛盾,所以排除6

5:如果自己取後留下8,對方取4個,與(3)一樣情況,所以也排除8

6:同樣,9也不行,如果我抽後剩下9,對方抽2個,就反過來成對方抽剩成7個了,也與(3)矛盾,所以也排除

7:所以很顯然,我只能抽剩1,4,7

8:因為只能抽後剩1,4,7才能贏,我先抽得話不可能達到這幾個數,很顯然,只能讓對方先抽,也即是先抽的人輸

TAGS:題目 筆試 SAP