SAMESNAK - Editorial

May be you can take a look at my code:


[1]


  [1]:https://www.codechef.com/viewsolution/13671836

can someone tell me,whats wrong with my solution,or suggest a test case it fails for
https://www.codechef.com/viewsolution/13760654
thanks

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

This is my solution. I guess the cases most users must be missing is complete overlap of two snakes.
eg

0 2 0 8
0 3 0 5

Here the answer should be yes. My solution is pretty simple, as it takes all cases into consideration and uses if-else alone to print the answer.

Yess, I got it but I am still not able to get what is going wrong in my code…! Is there any way I can see that test-case like we can do in CF…?

Can you please provide the test case for which my code fails.Link to my code is-
https://www.codechef.com/viewsolution/13772896

@jayprakash_a
test case failing
-1 2 -4 2 -1 2 8 2
answer should be no

@jeetu86044 for input -1 2 -4 2 -1 2 8 2 answer should be “yes” I guess.How can it be “no” when they have one overlapping point i.e. -1 2. Correct me if I am wrong.

@the_king_i_am

yes it was actually typing mistake

the original test case is:
1 2 4 2 -1 2 -8 2

ans: no

I am getting correct answer even in this case. From past two-three days I am not been able to find out where I am getting wrong. Here is Link of my solution. Can you help me out please. @shashank96 @sumedhk @jeetu86044

hi,
could anyone please look at my code and tell me for which test case it fails, i am unable to find the failed test case.

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

This is my code, can some one point out the mistake please link- https://www.codechef.com/viewsolution/13736370

@max3no

1
1 1 1 3
1 0 1 4
no

the original test case is: 1 2 4 2 -1 2 -8 2

From past two-three days I am not been able to find out where I am getting wrong. Here is Link of my solution.
Can you help me out please. @shashank96 @sumedhk @jeetu86044 @the_king_i_am

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

I can’t find anything wrong in it.

Plz help me find the bug. Appreciate it.

Thanks in advance.

Can anyone help me? I am unable whats wrong with my code:
My logic is:
if both are horizontal and y11==y21:
if (smaller x co_ordinate of each snake is smaller than larger x co-ordinate of other) :
print(yes)
else:
print(no)
My code is:

https://www.codechef.com/viewsolution/13766079
plz someone help me whats wrong with this smaller x co_ordinate of each snake is smaller than larger x co-ordinate of other BY THIS I MEAN IS :
if x11<x12 and x21<x22 then in order to overlap we must have: x11<x22 and x21<x12

Can someone, please tell me where did I go wrong? I am having really a bit of trouble with this simple code!
https://www.codechef.com/viewsolution/13740052
thanks in advance

@free_bird Your code is failing on test case 0 0 0 0 , 0 1 0 -1 as your answer is no
@kunwarpreet281 You are getting an error because you are printing extra new line before the answer
@amartya_bhatt You are failing test case 0 0 0 0,1 0 -1 0 .Correct answer should be yes but your are getting no
@babloo_1997 You failing both the test cases mentioned for free_bird and amartya_bhatt

@swamicoder You are failing the test case 0 0 0 -10,0 -5 10 -5.Remember not to use multiple relational operators in single statement as you have done in your code. For eg. for statement (i==j==k==l) ,when parsed your code will look like (((i==j)==k)==l) and now you can see very well why your code is failing. Happy coding :slight_smile:

1 Like

My someone help me which test cases my code fails!! I almost checked every test cases!! https://www.screencast.com/t/y3fod8MvjCG