dreamplay's blog

By dreamplay, history, 8 years ago, In English

Given a polygon of n points in counter-clockwise order and then some queries, result of each query being either INSIDE(point is inside or on the boundary) or outside (point outside the boundary)
This is the code I refer to.
Input:
3
0 0
2 0
2 2

1 1

Output:
Outside

Expected Output:
Inside ( point is on boundary )
Am I missing something, or is there an error while handling the boundary case? Similar error is also commented in russian on the link.

  • Vote: I like it
  • +8
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Yes, the code is incorrect (unless I missed some note in Russian).

It gave me lots of headaches last year when I was testing problem J of SWERC 2015 (my code didn't agree with e-maxx code). I couldn't discuss it because it was during the problem preparation phase. I forgot to report the issue after the contest.