← All problemsSign in

Polygon and String

You are given a list of $n$ points $p_0, p_1, \ldots, p_{n-1}$ in convex position (i.e., all of the points are vertices of their convex hull), such that no three points are collinear and no two points have the same $x$ or $y$ coordinate, so for any $i,j$ we have $x_i \neq x_j$ and $y_i \neq y_j$ where $p_i = (x_i, y_i)$ and $p_j = (x_j, y_j)$. You will be given a number of queries. Each query is

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start