题面 既然是模板, 那就直接贴代码? 两种思路 1.迪杰斯特拉 #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int N = 500007; int head[N], cnt, n, m, s; long long dis[N]; bool vis[N]; struct node { int next, to; long long w; }e[N]; void add(int x, int y, long long z) { e[++c...