Register
|
Login
HOME
PROBLEMSET
ROADMAP
COMPETITION
TOPIC
RANKING
GUIDE
MASHUP
ABOUT
CONTACT
Solutions of Jogging - MarisaOJ: Marisa Online Judge
Solutions of
Jogging
Select solution language
All
Tiếng Việt
English
Other
Write solution here.
KevinLe0801
Created at
4 likes
Use BFS to get the minimum distance from root to all vertices. Gather all found length into an array, sort in descending order and print the sum of K largest length