Villages
CodeChefOpen on judge ↗
Europol has captured Rio in a district. The district consists of $N$ villages. The villages are numbered ${1,2,...,N}$. There are $M$ 1-way roads which connect pairs of villages. We are provided with a list of $K$ 2-way roads. The task is to minimize the shortest path between village A and village B, by constructing one of the $K$ 2-way roads, so as to get Rio alive. Can you unleash the Professor
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