Getting TLE by solving the question using PBDS?

Sir used the same logic but instead I created a vector of PBDS and then I found out the number of elements greater than k by using order_of_ key () function, but I dont know I am getting TLE in this question. order_of_key() gives the answer in log n time .

@ash_sinha,
The insert used for pbds is not a O(1) operation, which makes your build function too slow. You can check that by submitting without query function, it will still give TLE.