← All problemsSign in

Nikitosh and Sauron-tetrahedron

CodeChefRating 2932Open on judge ↗

A dark tetrahedron's size is said to be N if each of its edges consists of N segments. To destroy a dark tetrahedron of size N, you have to erase at least N segments (you can't destroy a dark tetrahedron partially: the tetrahedron uses dark magic to self-cure if you erase less than N segments, and so it's the same as not erasing any segment). Also, to protect yourself from the tetraheldral curse,

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