Facing Doubt in Median in a stream of running integers Challenge

The link to my code is - https://ide.codingblocks.com/s/365414 . All my test cases are being shown wrong and some are showing TLE. Please tell what is the error.

hello @abhaygarg2001

check now (mistake specified in comments)->

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.