I: Polygon Game
https://open.kattis.com/problems/polygongame
Last updated
https://open.kattis.com/problems/polygongame
Last updated
The main observation is that the final number of pieces in the polygon cannot be too big!
Even though each of the lines (cuts) has the potential to cut each polygon into two pieces (which might suggest that you can form pieces), the total number of pieces is actually at most .
Now, we can just simulate the polygon cutting process, which can be implemented trivially once we have primitives such as computing line intersections.
Maintain a list of existing polygons.
At each iteration, intersect the line with every polygon in the existing list.
Replace the list of polygons with the new (potentially) smaller polygons created in this iteration.
Finally, iterate through all the polygons that remain in the end, and report the maximum area.