Virat and Anushka
CodeChefOpen on judge ↗
###Problem Statement: Keteki Country has $N$ connected cities (numbered 1,2,3,...,N) and $N-1$ bidirectional roads.A road from $X$ to $Y$ means that we can travel from City $X$ to City $Y$ and vice-versa.City 1 is the capital of Keteki Country.As the distance of a city from the Capital City increases,the quantity of vegetables increases. Kohli takes Anushka for a tour to Keteki Country.As we all
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