Wrong answer verdict

I have written code and code is giving correct answer for designed test case, yet it is not passing .Please help me.Link for code : https://ide.codingblocks.com/s/218575

@Debugger hey, after pushing the element, directly check the difference in size of heaps, if its 2, then pop one element from the larger heap and push it to the smaller one, now check whether both the heaps have same size (take average) , else median is from the larger heap.
Also take median etc long , to prevent overflow.
If this resolves your doubt mark it as resolved.

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.