CSAcademy Round 34

CSAcademy Round 34 was today, It was a while since I did competitive programming and surprisingly I ranked 9, it seems I perform relatively fast when facing easy problems.
The hardest problem was about counting the number of sub-polygons that contains a given point P . My approach was solving the inverse problem i.e the number of sub-polygons that does not contain the point.

For every vertex i of the polygon, we can find the furthest vertex j such that P is at the left of the segment ij, now we can create a subpolygon that does not contain P just by choosing k-1 of the vertices that are between i+1 and j

Author: Alei Reyes

I know that I know nothing

Leave a comment