Getting wrong answer

I am doing this question from coderforces(a2oj ladder B…question no-53).
This is the question…
https://codeforces.com/problemset/problem/151/B
This is my solution…
https://codeforces.com/contest/151/submission/98776687
Don’t know …why it is showing wrong answer.
Please look this into…
Thanks…

hello @ashishnnnnn

ur compare function will change the order.

do this->
iterate ur prepared vectors (piz,gir,tax) without sorting.
and find maximum value in each vector.
and then again traverse the vector and filter out the entries which is having value = max value .
and print.

note-> swapping happens when compare function returns false.

Yes… It worked…
But can we do this using some our own compare function… What if we use return true there…
By the way…
Late wish of Diwali…
Happy diwali… :slight_smile:

yeah we can.
store original indices along with the other two entries .
now sort in decreasing order of values (no need to handel any other conditions).
get max from 0th entry.
now filter all entries with value same as max and push them in vector.

now sort this vector in ascending order of original indices.
and print.

yeah thanks,same to u