CF1515I Phoenix and Diamonds

· · 个人记录

按照 w 排序。

按照当前二进制最高位分大小物品。

大物品只会出现选择 O(\log n) 次。

小物品出现选不了的情况也只有 O(\log n) 次。