Eeyore's blog

By Eeyore, 10 years ago, In English

Consider this problem statement: 13B - Letter A

As far as I understand it, the following input does not represent a letter A because the angle between the first and second segments is equal to zero.

1
0 4 0 0
0 4 0 0
0 1 0 2

Yet I have a passing submission that prints "YES" for the input above: 10215631

I also have a passing submission that prints "NO" for the above: 10215660

The only difference between the two submissions is the last line of the function goodAngle.

This yields true for the case above:

return ax*bx + ay*by >= 0

This yields false:

return ax*by != bx*ay && ax*bx + ay*by >= 0

I believe the correct result is false and the input case shown above should result in "NO". Therefore, either the system tests missed all such cases or this case is considered invalid for some reason.

Which is it? Does anyone else think the system tests are incomplete?

  • Vote: I like it
  • 0
  • Vote: I do not like it