Travel with Thomas
CodeChefOpen on judge ↗
Thomas Shelby is bored staying in Birmingham. He wants to travel and asks for your help. There are $v$ cities numbered from $1$ to $v$ in your country. Also, there are $e$ roads connecting the cities. One can go from city $u_i$ to $v_i$ (and vice versa) using the $i-th$ road. No two cities have more than one road connecting them. You can start your travel from any city. Thomas wants to travel
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