今天,在论坛上看到一个很好玩的题目,特转载到这里分享下。虽然这道题目已经有一定年份了~~~(四年前的了)希望敢兴趣的人思考一下哦~~~
You have been given 2 special, extremely rugged Xboxes. You are in an office building that is 100 stories high. Using the fewest possible number of drops from windows in your office building, determine the highest floor you can drop an Xbox from and have it survive: for example, they might be able to take the drop from the 30th floor, but not the 31st. You can break both Xboxes in your search. State the worst case number of drops needed and explain how you arrived at that answer.
你在一幢100层的办公楼里上班,现在给你两台xbox(已经特意捆绑包扎好),要求你用尽可能少的试摔次数来判断xbox摔不坏的最高楼层层数。比方说,从30层丢下来没问题,但从31层丢下来就不保了。在摸索过程中,允许把两台xbox都砸烂。
详细解释你的答案和思路。
PS:其中隐含了几个“公理”~~
公理1:所有的xbox都一样。
公理2:某一层上的任意位置均视为具有相同的高度。
公理3:xbox没有HP。换句话说,如果在某高度试摔xbox一次不烂,则在此高度无论摔多少次xbox也不会烂。
公理3:如果xbox在第x层摔不坏,则xbox在所有低于x层的楼层也一定不会摔坏
若不承认这些公理,这题就没意思了