WRONG ANSWER for CRAWA(The Leaking Robot)

Why is this code giving a WRONG ANSWER?PLease answer.Thanks in advance.
Link to my Solution- http://www.codechef.com/viewsolution/4924091

1 Like

I did not go through the technicalities of your solution yet, but in the first glance i see that in all the functions xplus, xminus and yplus, u have taken the for loop to go from i=0 to i<=n. However in yminus u have taken it to be from i=0 to i<n and not i<=n . Was this intentional from your side? And anyway your code is giving wrong answers for the following test cases(sample) :

t=4
2 26
-1 40
40 -1
-1 -4
So, now You myt just figure out whats wrong :slight_smile:

2 Likes

Thanks for your reply.I get the mistake :slight_smile:

1 Like
//