rt。本题在 N,K≤105N,K\le10^5N,K≤105 的数据面前 SPFA 是错的。能卡飞的。 下面是加强版题目。https://www.luogu.com.cn/problem/U225791
应该卡爆了所有 SPFA。如果您能过私信我并接受我的顶礼膜拜。