摘要: 换源点来不断进行单源最短路的计算。 #include <stdio.h> #include <stdlib.h> #include <queue> #include <algorithm> #include <cstring> #define R(x) x = read() using namesp 阅读全文
posted @ 2023-10-24 19:42 Gold_stein 阅读(19) 评论(0) 推荐(0)
摘要: 这道题要求的就是最短路中的最大值 注意:Floyd算法中第一重循环是[1,n] 而不是[1,n),因为1~n中任何一个点都有可能是中转点。 #include <iostream> #include <algorithm> #include <cstring> using namespace std; 阅读全文
posted @ 2023-10-24 17:18 Gold_stein 阅读(22) 评论(0) 推荐(0)
摘要: 最短路模板题 #include <stdio.h> #include <stdlib.h> #include <queue> #include <algorithm> #include <vector> #include <cstring> #define R(x) x = read() using 阅读全文
posted @ 2023-10-24 17:12 Gold_stein 阅读(19) 评论(0) 推荐(0)