Help Goku!
CodeChefOpen on judge ↗
Goku has just learnt the instant transmission. A power which enables a person to travel from point A to B in an instant. However, for instant transmission between two points, there should be a direct path between them (they should be directly connected). Also, instant transmission takes 1 unit of energy. You are given N points in space and M connections between them. Goku is initially standing at
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