Spread of Information
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
[ARC116E] Spread of Information
题面翻译
给定一棵 个点的树。要求在树上选择 个关键点 ,使得 最小。其中 是指树上 到 的最短路径经过的边数。
输入格式
第一行两个整数 ,接下来 行每行两个整数 表示一条树边。
输出格式
一个整数表示答案。
样例 #1
样例输入 #1
5 2
1 2
2 3
3 4
4 5
样例输出 #1
1
样例 #2
样例输入 #2
5 1
1 2
1 3
1 4
5 4
样例输出 #2
2
样例 #3
样例输入 #3
20 3
2 15
6 5
12 1
7 9
17 2
15 5
2 4
17 16
12 2
8 17
17 19
18 11
20 8
20 3
13 9
11 10
11 20
14 8
11 7
样例输出 #3
3
提示
数据范围
20241224集训
- Status
- Done
- Rule
- IOI
- Problem
- 6
- Start at
- 2024-12-24 19:00
- End at
- 2024-12-24 21:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 15