← All problemsSign in

NEW YEAR BONUS

The new year has just arrived in Chefland. All the states have decided to send the signature craftworks to all other states. Chefland has a great road network, and so the gifts are being sent by road. The number of inter-state roads in Chefland are minimum, but there always exists a path between any two states. It costs $1,000,000$ coins to travel between any two states, if a road exists between

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