当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

BZOJ1950:[Ceoi2006]Link

题目描述
给 N个点N 条边的有向图。 要求添最小的边,使得点1 到达其他所有点的最短路长度不超过K。
输入解释
The first line of input contains two integers N and K (2 ≤ N ≤ 500 000, 1 ≤ K ≤ 20 000) – the number of pages and the target maximum number of links to be followed. Each of the following N lines contains two different integers A and B (1 ≤ A, B ≤ N) meaning that the link on page A points to page B.
输出解释
The first and only line of output should contain a single integer, the minimum number of additional links required to make the website K-reachable.
输入样例
14 4 
1 2 
2 3 
3 4 
4 5 
7 5 
5 6 
6 3 
8 10 
10 9 
9 8 
14 13 
13 12 
12 11 
11 14 
输出样例
3
提示

one possible solution is to add the links 1→7, 1→14 and 14→10

BZPRO Powered by Remmina.
Github Repository
来自acmore.cc的附加信息
bzoj_id 1950
import_source_sha256 4d629ab95a887c47f81df0afbeb18aae3be1353790542fe7bdffc9a2d22763f6
bzoj_checker_pending False

该题目包含在题集 大视野(八中)OJ 中

题目来源 BZOJ 1950

源链接: LOCAL-BZOJ1950

共提交 0 次

通过率 --%
时间上限 内存上限
10000 MS 64 MB