题目: https://www.luogu.org/problem/P2939
约翰一共有N)个牧场.由M条布满尘埃的小径连接.小径可 以双向通行.每天早上约翰从牧场1出发到牧场N去给奶牛检查身体.
通过每条小径都需要消耗一定的时间.约翰打算升级其中K条小径,使之成为高 速公路.在高速公路上的通行几乎是瞬间完成的,所以高速公路的通行时间为0.
请帮助约翰决定对哪些小径进行升级,使他每天从1号牧场到第N号牧场所花的时间最短
#include<bits/stdc++.h>
#define pii pair<int, int>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e6 + 9;
const int MAXM = 24100000; //双向边, 边数(M * k + N * k) * 2
//const int MAXM = 5000009 * 6;
int n, m, k;
struct Edge
{
int to, w, nxt;
}edge[MAXM];
int t;
int head[MAXN];
void init()
{
memset(head, -1, sizeof(head));
t = 1;
}
void addEdge(int u, int v, int w)
{
edge[t].to = v;
edge[t].w = w;
edge[t].nxt = head[u];
head[u] = t++;
}
int dis[MAXN],