← All problemsSign in

Someone is Curious

Anushka lives in the snow-capped country of Fracture. Fracture has $N$ cities numbered $1$ through $N$ where the numbers correspond to the **beauty** of that city. There are $N$-$1$ bidirectional roads connecting the $N$ cities where Road $i$ connects City $U_i$ and $V_i$. It is guaranteed that there is at least one path between every pair of city. Anushka decides to travel all the cities in Frac

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