My code is showing TLE
One optimisation could be taking minheapsize=0 , maxheapsize=0 and adjusting the size during operation it will reduce the time of calculating minheap.size(). Even I faced the same problem. Integer part of median is asked in the question correct your code.
You can use these lines inside main for fast i/o:
ios_base::sync_with_stdio(false);
cin.tie(NULL);
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.