← All problemsSign in

Tree of PoRs

It's time to select the next set of students who will be part of Saastra 2020! (The same goes for Shaarang, but nobody cares about them anyway.) The set of students who organised Saastra 2019 will be influential in this selection, and many of them will actually be applying to join next year as well. The structure of the Saastra 2019 organisation is a tree with $n$ students, rooted at student $1

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