Solutions of Jogging - MarisaOJ: Marisa Online Judge

Solutions of Jogging

Select solution language

Write solution here.


User Avatar 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