Throwing the fattest people off of an overloaded airplane.

后端 未结 12 1727
迷失自我
迷失自我 2020-12-04 04:42

Let\'s say you\'ve got an airplane, and it is low on fuel. Unless the plane drops 3000 pounds of passenger weight, it will not be able to reach the next airport. To save t

12条回答
  •  遥遥无期
    2020-12-04 05:19

    I would probably use std::nth_element to partition off the 20 heaviest people in linear time. Then use a more complex method to find and bump off the heaviest of the heavies.

提交回复
热议问题