Wait, what do you mean by “correct output”? If i am not wrong, the snakes here intersect as “|-” (T rotated by 90 degree anticlockwise). Here the vertex (0,50) is of degree 3 and hence a no has to be printed. Can you please show me your perspective/PoV so we can clarify it further?
Can anyone point out why I got WA for this solution of SAMESNAK? I am just not able to figure out where I went wrong in this: https://www.codechef.com/viewsolution/13689668
Some details of this solution:
hoanvi(int a, int b): swap a and b;
giaonhau(int a, int b, int c, int d): if [a,b] and [c,d] overlap, return 1 else return 0
Thanks a lot @vijju123 . It was a connection issue due to which the comment got posted later .I was talking of the case which you pointed out for another user .
Please get rid of those excess whitespaces. It becomes a headache for the person trying to fix/debug your code. Nobody would want to help if its inconvenient.
Your code prints correctly for if i change “5 2 -1 2” to “5 2 1 2”, but prints wrong answer other than that (if that value is <1, eg- 0,-1 etc.). I believe its a case of complete overlapp of snakes. Look into it.