返回题库

有毒葡萄酒

Poisonous wine

专题
Algorithmic Programming / 算法编程
难度
L4

题目详情

1000 瓶酒里有 1 瓶有毒。我们只有 20 小时;毒酒会在老鼠喝下后 18 小时致死,且此前不会出现任何症状。现在有 10 只老鼠可用。如何找出哪一瓶有毒?

1000 wines, 1 is poison. We have 20h, poison kills a mouse in 18h, no symptom earlier. 10 mice available. Identify the poison bottle?

解析

可以。

把瓶子编号为 1..1000,用二进制表示编号(需要 10 位,因为 210=1024>10002^{10}=1024>1000)。

让第 ii 只老鼠(i=1..10i=1..10)喝所有“二进制编号第 ii 位为 1”的那些瓶子的混合样本。

18 小时后观察哪些老鼠死亡,就得到一个 10 位的 0/1 模式,这个模式正好对应毒瓶的编号。


Original Explanation

Yes. Label bottles 1..1000 in binary. Let each mouse drink from bottles whose bit=1 in that mouse’s position. 18h later, note which mice die => 10-bit pattern => the bottle number. 210=1024>10002^{10}=1024>1000.