Racing Horses

//Whats wrong in this code, showing wrong answer
https://www.codechef.com/viewsolution/27705615

@jarvmac9 there is small mistake that you are taking input of the n outside the loop of test cases. you should define and take input of n inside the loop for(int i=0;i<t;i++)
{}
For reference, see my solution CodeChef: Practical coding for everyone

No its not working

You should post your doubt here: HORSES - Editorial - #10 by cyclicfunction
i think its a better choice

Can someone please point out the mistake I’ve made. I’m stuck on this problem.

https://www.codechef.com/viewsolution/36166745

Consider the test input:

2
5
4 9 1 32 13
5
4 9 1 32 13
3 Likes

Thanks a lot, I realized the issue about 10 minutes ago, when I tried something similar.

1 Like