LTIME WSC solution

what is the problem with my code can anybody help me figure it out.

http://www.codechef.com/viewsolution/5471942

the logic which i figured out was that for any query
this set of queries should not exist

(i,j)
(j,k)
(i,k)
where (i, j ,k) belong to 1<=i,j,k<=n
as for if the element set existed , one of elements in set

(i,j)
(j,k)
which is common i.e. j is transported to other corner then too i is eaten by k
hence transportation can’t be done. please tell if possible error exist

Try cases like:

10 2

2 3

3 6

OR

10 0

Your solution doesn’t give any output…

1 Like

i am not asking for test cases but problem with the logic

While you didn’t described your logic, you can hardly ask for that. From my point of view, failing test case is always preferred. Read this.

1 Like

It is true that (i,j), (j,k), (k,i) should not exist. If it does, the output should be NO… But you are neglecting other cases where a NO (or YES) is possible. That’s the reason for the WA!

can you please let me know those cases.

Consider (i,j), (m,n)… This will also give a NO always