Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Zaurus 中文论坛 Forum Index » 经典难题

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
[转帖] 一道面试题
View previous topic :: View next topic  
Author Message
gnod



Joined: 14 Dec 2006
Posts: 2

小企鹅: 68

PostPosted: 2006-Dec-14 Thu, am3:15 Reply with quote
 Post subject: [转帖] 一道面试题

1000瓶葡萄酒里知道有一瓶是有毒的,你可以用10只老鼠测试,老鼠喝到毒酒2小时后会有中毒反应。
请你设计方案,用3小时找出尽可能多的安全的酒。
Back to top
View user's profile Send private message
wowotou



Joined: 27 Nov 2006
Posts: 38

小企鹅: 1101

PostPosted: 2006-Dec-14 Thu, am9:13 Reply with quote
 Post subject:

如果是精确的2小时 把酒分成10瓶一组 100组 在1小时内测完(有点难)
再过1小时开始卡表
等出现中毒的 根据时间确定是哪一组 根据老鼠确定是哪一瓶
Back to top
View user's profile Send private message
米迈7500c



Joined: 01 Nov 2006
Posts: 46

小企鹅: 1568

PostPosted: 2006-Dec-14 Thu, am11:29 Reply with quote
 Post subject:

用老鼠来做循环,编成ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ号,酒分成ABCDEFGHIJ组每组分为12345678910,十只老鼠同时进行,I尝A1-100,Ⅱ尝B1-100,......每分钟一瓶酒,100瓶尝完后用了100分钟,然后Ⅰ尝B1-10,C1-10.......,Ⅱ尝A11-19,B11-19,....用掉90分钟,如果第Ⅵ只和第Ⅷ只倒,那么就应该是:F组,第81-90瓶酒有问题,能排除990瓶酒。当然还有好几种可能性,有可能老鼠还没尝到最后一瓶就倒的情况。大家看这个答案如何?超过10分钟可在第二次的时候老鼠前9轮尝9瓶,最后一轮尝8瓶,如何?实际上是wowotou版答案的说明了。
Back to top
View user's profile Send private message
gnod



Joined: 14 Dec 2006
Posts: 2

小企鹅: 68

PostPosted: 2006-Dec-14 Thu, pm4:35 Reply with quote
 Post subject:

时间其实也不用那么精确了, 主要的意思是最短的时间里, 验证最多的酒是无毒的.
Back to top
View user's profile Send private message
tanck



Joined: 21 Jan 2007
Posts: 5

小企鹅: 138

PostPosted: 2007-Jan-21 Sun, am3:13 Reply with quote
 Post subject: 对玩IT的这个应该简单到不得了吧

其实就是二进制编码的问题啦
2的10次方就有1024了
把酒瓶编成1到1000
然后把编号转成二进制
十只老鼠每只老鼠对应二进制上的每一位
根据二进制编码来决定每瓶酒由哪几只老鼠尝
比如1#瓶就只给老鼠1#
2#瓶就只给老鼠2#
3#瓶就给老鼠1#和2#
预先把给每只老鼠尝的酒调好一次尝就行
两个小时以后看哪几只老鼠中毒
把编号数字再转成十进制就知道哪一瓶酒是有毒的了
Back to top
View user's profile Send private message
Display posts from previous:     
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Zaurus 中文论坛 Forum Index » 经典难题 All times are GMT + 8 Hours
Page 1 of 1

 
Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

[ 页面生成时间: 秒 ] :: [ 次查询 ] :: [ ]
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional