← All problemsSign in

What is this, a crossover episode

You are given a simple polygon (that is, its edges don't intersect with each other, apart from touching at the vertices) with $n$ vertices. The vertices are numbered, in clockwise order, as $1, 2, \ldots, n$. Additionally, there are $m$ non-intersecting chords within the polygon. Note however that chords can touch each other at a vertex of the polygon. A chord is defined to be a line segment conne

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