摘要: 这道题实际上不需要最短路算法,因为每条边的边权都只有1 要注意在开始读入交通路线之前,要先把一个空行先读掉 这道题是“公交线路” 是有方向的 所以只能连单向边 #include <iostream> #include <cstring> #include <algorithm> #include < 阅读全文
posted @ 2023-10-25 13:10 Gold_stein 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 通过取对数把乘法变成加法,然后应用相对应的最短路算法 #include<algorithm> #include<queue> #include<stdio.h> #define R(x) x=read() using namespace std; const int N=2005; int n,m; 阅读全文
posted @ 2023-10-25 10:41 Gold_stein 阅读(2) 评论(0) 推荐(0) 编辑