电话线 题目链接:https://www.luogu.org/problemnew/show/P1948 二分答案+最短路 我们要求一条1~n的路径,使其中的第k+1大的数最小. 二分第k+1大的数的大小h,比h小的边可以看为0,因为它们不会让第k+1大的数更大:比h大的边边权设为1,最后求出的1~n的最短路,就是在第k+1大的数小于等于h时需要让电信公司承担的电话线数,因为在第k+1大的数的大小限制为h的情况下,任何比h大的数都不可以自己承担.若dis[n]>k返回false,否则返回true…