Hotel Tour
CodeChefOpen on judge ↗
You booked a very lavish hotel. The hotel has $N$ rooms. Each room is numbered from $1$ to $N$. There are also $N - 1$ corridors, each $i^{th}$ corridor connects room $a_i$ to room $b_i$. It is known that you can travel between any two rooms using only these corridors. Also you are free to tour into any room as you wish. You are listening to a music and want to take a tour of the hotel before a
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