这道题就没题解用 O(N)吗?

P1678 烦恼的高考志愿

天南星魔芋 @ 2021-02-22 09:54:37

RT

翻了一下所有题解 最低也是 O(NlogN)

明明桶排是 O(N) 没人用

然后处理一个前缀一个后缀

在用 NO(1) 查询就行了

于是


by Textbook_blasphemy @ 2021-02-22 09:56:31

%%%


by 日居月诸 @ 2021-02-22 10:01:54

%%%


by expect @ 2021-02-22 10:08:20

@天南星魔芋 事实上是O(值域)


by 天南星魔芋 @ 2021-02-22 10:17:39

是啊(然而还是快了很多)


by UperFicial @ 2021-02-22 10:22:30

%%%


by djwj233 @ 2021-02-22 10:31:02

%%%%


by ezuyz @ 2021-02-22 13:31:12

%%%


|