利用spfa的搜索,暴力更新每一个点的最大差价,和最小成本对最短路不是很熟悉,开始写的时候把最大差价的初始值赋错了,汗 #include<bits/stdc++.h> using namespace std; const int inf=0x3f3f3f3f; const int N=5e5+55; const int M=1e5+55; int head[N<<1],val[M]; int cnt; struct node{ int to,next; }mp[N<<1]; struct nod{ int maxn,minn; }eg[M]; void ad...