Tle in one test case

hey how can i optimise my code. Please give some hint.

hello @Aparna
u are using min heap for this problem.
due to which for each query of type 2 . u are performing O(k) work. so for q such query it will be O(k*q) which will clearly give tle.

hint -> use max heap.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.