My code is passing the 2nd test case but is showing TLE for the 1st test case. Please Help!!
Hostel Visit Problem
hello @avijuneja2007
you are using min heap for this problem due to which for each query of type 2 u will be performing k operations and for q such queries u will be performing O(q*k) operations,
and because of this u are getting tle.
hint for optimisation-> use max heap
1 Like