Running Median Doubt

I tried the problem as explained in the tutorial, but I’m not getting the correct output, I really have no clue why.
Please let me know where I’m going wrong?

Question - https://hack.codingblocks.com/contests/c/718/1274
My Code - https://ide.codingblocks.com/s/98478
PS: I’m just solving the problem for a single test case.

Hi Pulkit,
In the imbalance condition when you are supposed to move elements from a larger heap to a smaller heap , you have made a little mistake in pushing the element. Particularly in line no 28 and 34. You should be pushing ‘x’ rather than ‘a’

Damn,yes
Thanks a lot!

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.