Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Number of interesctions

Правка en2, от Vasiljko, 2017-11-10 17:59:35

Given convex polygon with N points (clockwise and there are no 3 collinear points). Also given M vertical line segments. Find out how many edges of polygon are intersected by at least one line segment.
Note that if line segment is going through one of the N points, then both edges are counting.

Points are represented as Xi Yi.
Line segments are represented as Ai Pi Ki which means that starting point is at (Ai,Pi) and ending point is at (Ai,Ki)

3 <= N <= 10^5
1 <= M <= 10^5
-10^7 <= Xi,Yi,Ai,Pi,Ki <= 10^7
TL: 1s
ML: 64MB

Теги #geometry, line sweep, line intersections

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Vasiljko 2017-11-10 17:59:35 0 (published)
en1 Английский Vasiljko 2017-11-10 17:57:55 589 Initial revision (saved to drafts)