Sap笔试题目分享

乐求学 人气:1.91W

and Diamond like playing game of coins,One day theydesigned a new set of rules:

Sap笔试题目分享

1)Totally 10 coins

2)One can take away 1,2or 4 coins at one time by turns3)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)矛盾,所以排除65:如果自己取后留下8,对方取4个,与(3)一样情况,所以也排除86:同样,9也不行,如果我抽后剩下9,对方抽2个,就反过来成对方抽剩成7个了,也与(3)矛盾,所以也排除7:所以很显然,我只能抽剩1,4,7

8:因为只能抽后剩1,4,7才能赢,我先抽得话不可能达到这几个数,很显然,只能让对方先抽,也即是先抽的人输

TAGS:笔试 SAP 题目