You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are given a strictly convex polygon with N
vertices (numbered 1
through N
). For each valid i
, the coordinates of the i
-th vertex are (Xi,Yi)
. You may perform the following operation any number of times (including zero):
Consider a parent polygon. Initially, this is the polygon you are given.
Draw one of its child polygons ― a simple non-degenerate polygon such that each of its sides is a chord of the parent polygon (it cannot be a side of the parent polygon). The operation cannot be performed if the parent polygon does not have any child polygons.
The child polygon which you drew becomes the new parent polygon.
Your goal is to draw as many sides of polygons in total as possible (including the polygon given at the start). Find this maximum total number of sides
Enter link to the question(if question belongs to any online platform) -
Enter your question -
You are given a strictly convex polygon with N
vertices (numbered 1
through N
). For each valid i
, the coordinates of the i
-th vertex are (Xi,Yi)
. You may perform the following operation any number of times (including zero):
Consider a parent polygon. Initially, this is the polygon you are given.
Draw one of its child polygons ― a simple non-degenerate polygon such that each of its sides is a chord of the parent polygon (it cannot be a side of the parent polygon). The operation cannot be performed if the parent polygon does not have any child polygons.
The child polygon which you drew becomes the new parent polygon.
Your goal is to draw as many sides of polygons in total as possible (including the polygon given at the start). Find this maximum total number of sides
Enter link to the question(if question belongs to any online platform) -
https://www.codechef.com/problems/POLYREL
Tags for the question(eg - Array, Basic, Stack, etc.) -
Greedy, Geometry
The text was updated successfully, but these errors were encountered: