Get stuck in Polygons Intersection

Revision en2, by nhphuc, 2024-11-28 16:42:25

Today I was try to solve this problem: https://codeforces.me/gym/100952/problem/J.

My main idea is:

  • Find all point $$$X$$$s that $$$X$$$ is a node of $$$A$$$ and in $$$B$$$'s area.

  • Find all point $$$X$$$s that $$$X$$$ is a node of $$$B$$$ and in $$$A$$$'s area.

  • Find all intersection points of $$$A$$$ and $$$B$$$.

Let call the set of points we found is $$$S$$$, $$$S$$$ will be a convex hull, find the area of $$$S$$$ — the answer of problem.

But somehow I get WA verdict, can anyone help me to find out why, thanks all.

(This is my code: https://ideone.com/8wXu6a.)

Tags geometry, convexhull

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English nhphuc 2024-11-28 18:16:58 170
en3 English nhphuc 2024-11-28 16:55:24 1 Tiny change: 'com/8wXu6a.)' -> 'com/8wXu6a)'
en2 English nhphuc 2024-11-28 16:42:25 2
en1 English nhphuc 2024-11-28 16:42:03 585 Initial revision (published)