题目有提到注意 x 不一定在集合里。
所以使用__gnu_pbds::tree的order_of_key时,要判断xxx是否在容器里面。
__gnu_pbds::tree
order_of_key
__gnu_pbds::tree没有count函数,实现可以使用lower_bound或者额外维护一个set,如果没有就暂时插入,查完再删除。
count
lower_bound
set
我这种蒟蒻用pbds都能挂的也是