Floyd算法
void floyed(){
memset(f,0x3f,sizeof f);
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(a[i][j]!=0)f[i][j]=a[i][j];
}
}
for(int k=1;k<=n;k++){
for(int x=1;x<=n;x++){
for(int y=1;y<=n;y++){
f[x][y]=min(f[x][y],f[x][k]+f[k][y]);
}
}
}
}
SPFA算法
Dijkstra
标签:0x3f,floyed,int,短路,算法,Dijkstra
From: https://www.cnblogs.com/hnzzlxs01/p/16655980.html