← All problemsSign in

Rubber Band

CodeChefRating 2869Open on judge ↗

James has a board (a two-dimensional plane) with $N$ nails sticking out of it and a rubber band tangled up between these nails. The rubber band can be viewed as a closed curve made up of $M$ line segments (a closed polyline with $M$ vertices). None of the nails intersect the rubber band, but the rubber band may intersect itself. James wants to move the rubber band away from the nails. Specificall

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