倍增好题,f[p,i,j]表示i到j经过了2^p条边走过的最短路径显然f[p+1]可以由f[p]转移来然后对n二进制拆分累加即可 ; ..,..] of int64; f,pf:..] of int64; v:..] of longint; j,z,x,y,s,t,n,m,e,i:longint; function min(a,b:int64):int64; begin if a>b then exit(b) else exit(a); end; function get(x:longint):…