Throwing the fattest people off of an overloaded airplane.

后端 未结 12 1743
迷失自我
迷失自我 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:12

    @James has the answer in the comments: a std::priority_queue if you can use any container, or a combination of std::make_heap and std::pop_heap (and std::push_heap) if you want to use something like a std::vector.

提交回复
热议问题