Блог пользователя dreamplay

Автор dreamplay, история, 7 лет назад, По-английски

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.

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

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.