两个鸡蛋问题:
我确信已经充分讨论了两个鸡蛋问题(如上所述).但是有人可以帮助我理解为什么以下解决方案不是最佳的.
假设我使用段大小的分段和扫描算法s
.所以,
d ( 100 / s + (s-1) ) = 0 [ this should give the minima, I need '(s-1)' scans per segment and there are '100/s' segments]
-
ds
=> -100 / s^2 + 1 = 0
=> s^2 = 100
=> s = 10
Run Code Online (Sandbox Code Playgroud)
所以根据这个,我需要最多19滴.但最佳解决方案可以做到14滴.
那么问题出在哪里呢?
algorithm ×1