PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#FW0000012. Xe buýt và số phận (Bus and Unavoidable Destiny)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Xe buýt và số phận (Bus and Unavoidable Destiny)
Bus and Unavoidable Destiny
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Select a bus stop as home to minimize the maximum shortest travel time to every other stop, in a connected undirected bus network.
Input
followed by undirected routes .
Output
Print the minimum possible maximum travel time.
Subtasks
- Subtask 1 (40 points): ; ; ; ; .
- Subtask 2 (60 points): ; ; ; .
Examples
Input
3 2
1 2 10
2 3 10
Output
10
Explanation
At stop , the maximum shortest travel time is ; at either end stop it is .