report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Point location - MarisaOJ: Marisa Online Judge

Point location

Time limit: 1000 ms
Memory limit: 256 MB
Given a convex polygon of $n$ of vertices and a point $A(x_A, x_B)$. Determine if $A$ lies inside the polygon (lying on an edge is also counted as lying inside). ### Input - The first lines contains three integers $n, x_A, x_B$. - The next $n$ lines, each line contains a point $(x, y)$. The points are listed in the clockwise order. ### Output - Print `YES` if the point lies inside the polygon, otherwise print `NO`. ### Constraints - $ 1 \le n \le 1000$. - $-10^9 \le x, y \le 10^9$. ### Example Input: ``` 4 2 1 0 0 0 1 1 2 3 0 ``` Output: ``` YES ```
Geometry
Three points
Line segment intersection
Line intersection
Quadrilateral classification
Point location
Triangle classification
Polygon area
Distance to polygon
Convex hull
Perpendicular pairs
Maximum quadrilateral
Catching butterflies
Topic
Geometry
Rating 1100
Solution (0) Solution