微软经典面试题--海盗分宝石

最初由 大漠张三 发布



3必须要给的,要不然3会投否决的

4和5可以选一个给。但是我觉得保险2个都给比较好,自己97个就行了,不用那么贪

又不是真分,就弄出这一个也挺有意思的
 
最后我决定回答.....98,0,0,1,1@#$@%@^&^%*%
 
最初由 难波万 发布
因为2号会提议给4一颗~~所以给3和5各一颗~~行了~~back to ECE241 project~~:lol:


好像我们真有100颗钻石似的哈哈


我也back to ece241 project
 
明白了是所有人投票哦......那我死的话2跟3一定平分不给4,5.........所以这样就好了我98个,4跟5各一个哈哈~
 
又来一个98-0-0-1-1
我都忘了我是怎么说服no.1的了
 
这种面试题~~不用多~~一下来十道~~我这种程度的估计当场就晕倒~~

微软的要求也太高了吧~~
 
Very interesting. I'm not a computer scientist, but my first reaction is:

Since 4 and 5 are safe, and after 1,2,3 all die, 4 will get all 100 diamonds, 4 will vote against any proposal from 1,2,3 that gives him less than 100 diamonds.

5 will get 0 if 1,2,3 all die, so he will vote for any proposal from 1,2,3 that gives him at least 1 diamonds.

That's the simplest, you geeks figure out the rest. :)
 
For 3, if 1,2 all die, he can simply give 5 one diamond to keep alive, and himself will get 99, so he will vote against any proposal from 1,2 that gives him less than 99.

For 2, if 1 dies, he can also keep himself alive by giving 5 one diamond, and himself will get 99, so he will also vote against proposal from 1 that gives him less than 99.

Now for 1, the only way to keep alive is to give 5 one diamond and 99 diamonds to either 2 or 3, so that he will get votes from 2/3 and 5 to keep alive.

Final results: 0-99-0-0-1 or 0-0-99-0-1.
 
这个东西太不现实了,如果可以,我是海盗,我最强,就把他们都扔下去
唉!
他们强,我.....反正这个社会以大欺小是惯例!不行就装孙子呗

他们比你强,你还想要钻石?不打你就不错了!
或者联合其中最强的,把剩下的干掉
 
最初由 DickStrong 发布
Very interesting. I'm not a computer scientist, but my first reaction is:

Since 4 and 5 are safe, and after 1,2,3 all die, 4 will get all 100 diamonds, 4 will vote against any proposal from 1,2,3 that gives him less than 100 diamonds.

5 will get 0 if 1,2,3 all die, so he will vote for any proposal from 1,2,3 that gives him at least 1 diamonds.

That's the simplest, you geeks figure out the rest. :)


no

4 won't vote against any proposals. in fact 4 will vote for 2 if 2 give him one dimond

5 won't vote for anybody that gives him one dimond, in fact he will vote against 2 if 2 gives him one dimond

and you don't have to be a computer scientist to figure this out, you just need to pass grade 3
 
原来这道是微软的面试题目……
 
仁者见仁...智者见智......
 
最初由 DickStrong 发布
For 3, if 1,2 all die, he can simply give 5 one diamond to keep alive, and himself will get 99, so he will vote against any proposal from 1,2 that gives him less than 99.

For 2, if 1 dies, he can also keep himself alive by giving 5 one diamond, and himself will get 99, so he will also vote against proposal from 1 that gives him less than 99.

Now for 1, the only way to keep alive is to give 5 one diamond and 99 diamonds to either 2 or 3, so that he will get votes from 2/3 and 5 to keep alive.

Final results: 0-99-0-0-1 or 0-0-99-0-1.

这是保命分法,只要不死就行,太没追求了
如果用0-99-0-0-1的话,如果我是2我也投否决
反正等我上台也一样能拿99颗,否了1还能免费看看活人喂鲨鱼...
嘿嘿..
 
最初由 妖精 发布
这个东西太不现实了,如果可以,我是海盗,我最强,就把他们都扔下去
唉!
他们强,我.....反正这个社会以大欺小是惯例!不行就装孙子呗

他们比你强,你还想要钻石?不打你就不错了!
或者联合其中最强的,把剩下的干掉
同意..不过这是题目嘛..不管现实里有没有..你能做出来就厉害..做不出来就....
 
后退
顶部