最短路径(Dijkstra算法)也就是单源点问题!

/*Sample Input 5 5 1 2 20 2 3 30 3 4 20 4 5 20 1 5 100 Sample Output 90 */ #include<stdio.h> #include<string.h> #define N 1005 #define INF 0x3f3f3f bool s[N]; int d[N]; int path[N];//辅助记录通过的路程 int ma
相关文章
相关标签/搜索