← All problemsSign in

Wormhole Trips

You are given a map. There are $N$ points and they are connected by $M$ wormholes. A Wormhole connects two points $u$ and $v$ which are separated by exactly $1$ unit distance but it takes certain amount of time to pass through that Wormhole. Also, there is a Black Hole at point $1$! You might know that it is not a good idea to stay too close to any black hole. Rick knows that, hence he can 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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start