← All problemsSign in

Marathon on a Tree

Professor Carlson, The chief coordinator of the annual marathon in Oxford University, has decided to conduct a marathon for university students. The marathon needs to be coordinated and many paths were suggested. The city has $N$ nodes numbered through $1$ to $N$ and was engineered in such a way that all the nodes in the city are connected and there is only one simple path between any pair

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