Snakes
CodeChefOpen on judge ↗
Rainy Season has arrived and snakes have come out of their holes. Chef is watching them come out and is in mood of having some fun. He decides to find the maximum number of snakes who do not intersect each other but head of 1 snake can touch tail of other. A snake is represented by two points $x1$ and $x2$, which are head and tail points of a snake, respectively. Can you help Chef ? Here Input
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.
Sign in to chat with the tutor and save your progress.
Sign in to start