设临界楼层为 X。关键是让第一枚鸡蛋的试探步长依次递减:先在第 k 层扔,再在第 k+(k−1) 层、k+(k−1)+(k−2) 层继续尝试,依此类推。
如果第一枚鸡蛋在第 i 次时碎了,那么只需要用第二枚鸡蛋在线性检查前一个区间里剩下的至多 i−1 层。因此,这种策略的最坏情况总扔掷次数就是 k。
为了覆盖 100 层,需要
1+2+⋯+k=2k(k+1)≥100.
计算可得:
213⋅14=91<100,214⋅15=105≥100.
所以最小可行的 k 是
14.
也就是说,最坏情况下至少需要 14 次。
Original Explanation
Let the unknown critical floor be X.We have two identical eggs and 100 floors.Strategy: Drop first egg at floor k,k+(k−1),k+(k−1)+(k−2),…(increments k,k−1,k−2,…).If the first egg breaks on the i-th drop, then you need at most i−1 dropswith the second egg to linearly search the remaining interval.Thus, the worst-case number of drops is k.To cover all 100 floors: k+(k−1)+(k−2)+⋯+1≥100.⇒2k(k+1)≥100.Solve: 213⋅14=91<100,214⋅15=105≥100.∴k=14.