← All problemsSign in

Bulbasaur On Trip

Sinnoh(in PokeLand) has N(numbered 1 to N) pokespots and N-1 bidirectional roads. It is guaranteed that there is a road from any pokespot to any other pokespot. Since Bulbasaur has limited time so he can visit only K of them. He can start and end at any pokespot. Given the defintion of each road in Sinnoh find and print the minimum distance Bulbasaur must travel to visit K pokespots. The pokespots

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