CF95C 题解

· · 题解

思路

先跑一遍全源最短路(要用 n 次 dijkstra,floyd 可能会超时)算出距离,然后给 dis_{i\to j}\le t 的点对连上一条边跑最短路算距离。

Code。