Please help me fix my code for ROBOTG

@vijju123 So, I saw what you changed. Doesn’t make any sense to me. I am already doing calculations for max inside the loop. Doing them again makes it redundant, I think. I kept the last bit outside the loop because there were no comparisons in the end

In that case dear, here is the test case input http://pastebin.com/YVyGVLj1 and here is expected output http://pastebin.com/Am4cJnwp Check that for which case your code fails, and see how loops etc. work. There must be some minor mistake, because shifting that calculation inside loop gave AC. Have a check! :slight_smile:

Thank you so much for that input. I checked mine against a correct one. It turns out that the mistake was a typo. After correcting the typo, I got AC. Thank you for helping me out!
Here’s the solution, if you want to see https://www.codechef.com/viewsolution/13133941

1 Like

I am glad it worked dear :slight_smile: