Lightning rectangle question test cases seems weak or wrong

in this problem (snackdown problem 1)

3 10
0 5
2 3
2 7

picking up any top AC solutions from

gives the result yes on this test case while the correct ans should be no.

some of my verified solutions are :

not all but most of the solutions passed with wrong logic and this case was a strong edge case in it. so many got ac without handling this case. test cases seem to be weak.


So I did not feel like studying for exams and spent my evening analyzing accepted solutions for RECTLIT. I found that out of 363 accepted solutions in C++, only 253 pass the above test case. I did not check the solutions in other languages, however there are only 23 of them. So approximately 30% of all accepted solutions in C++ should get WA. Make of it what you will ¯\_(ツ)_/¯


“An ideal problem has no test data.”

alt text

1 Like

Lost my chance at winning a t-shirt because of this… One of the Python solutions I’ve found answers no if there are no points on the perimeter but still got accepted.

Light source at (0 5) lights toward bottom right direction, (2,3) toward top right and (2,7) toward top left.

@taran_1407 still point 1,6 is left dark

Sorry, I read the coordinates as (0,5),(3,2),(7,2). My Bad

The answer for the test case you mentioned is no.

1 Like

@taran_1407 I have updated bit details in the question. It seems like the test cases were weak in this question.


@taran_1407 @helloworld0001 same problem for me my code is getting is getting WA since i consider this case as no but all teams which considered yes are getting an AC.
@admin2 @vijju123 can u look into it will be helpful?

Wow, in a problem based on casework they forgot to put in all cases.


@meooow welcome to codechef XD


@lokesh2002 you don’t appear to have submitted a solution to this problem in codechef - did you submit under a team name? The problem described here is the opposite of your claim; this is about a case that isn’t tested, so incomplete solutions are getting AC. If you are unexpectedly getting WA, it’s more likely your code has an error.

Just curious, how did you test them all?

I wrote scripts to fetch all the accepted C++ solutions and run them locally.

Oh nice,Is the API open to common public now?

You wish. I don’t think CodeChef API will become public in my lifetime.

1 Like