Hospital in Berland
CodeChefOpen on judge ↗
In these tough times of the pandemic, the state of Berland has an urgent requirement of a hospital The state of Berland can be described as $N$ cities connected by $N-1$ bidirectional roads , there always exists a unique path between any pair of cities. Each city is treated as a node and each bidirectional road is treated as undirected edge. The given tree is rooted at node $1$. The number o
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