Not able to Pass Testcases

Please mark changes in my code where it is failing

Here is my code link: https://ide.codingblocks.com/s/228097

@navin_japes
you were doing i.e comparing a[i] with q.back() and not a[q.back()];
while(!q.empty() && a[i] > q.back())

Are you joking have you gone through that problem first read and check my solution and correct my mistake where it is wrong it is not passing first check and then forward the link

@navin_japes I corrected your mistake.
copy pasted the exact code https://ide.codingblocks.com/s/228108?_ga=2.264221004.1730471097.1588142190-514560086.1580045254
to this question https://hack.codingblocks.com/app/contests/1161/1084/problem
and it passed all the test cases.
Please next time while seeking help, seek it with humility.

You words were confusing see what condition you have written in first reply.