最短路学习笔记
三种算法
floyd
复杂度 :O(n^3)
应用场景:多源最短路,非负边
邻接矩阵存图
最短路
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int INF = 0x3f3f3f3f;
int n,m;
const int MAX_N = 105;
int d[MAX_N][MAX_N];
int main() {
while(scanf("%d
原创
2021-01-30 22:37:18 ·
59 阅读 ·
0 评论