#include <bits/stdc++.h>
#define forr(_a,_b,_c) for(_a = _b; _a <= _c; ++_a)
#define ford(_a,_b,_c) for(_a = (_b) + 1; _a --> _c;)
#define forf(_a,_b,_c) for(_a = _b; _a < _c; ++_a)
#define st first
#define nd second
#define ll long long
#define ull unsigned long long
#define pii pair <int,int>
#define pll pair <ll,ll>
#define piii pair <int,pii>
#define vi vector <int>
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define file "test"
using namespace std;
const int N = 2e5 + 5;
const ll oo = 1e9 + 1;
const ll mod = 1e9 + 7;
priority_queue <pll,vector<pll>,greater<pll>> q;
int n,m,k,i,u,v,w;
pll d[N];
vector <pll> a[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> m >> k;
forr (i,1,m){
cin >> u >> v >> w;
a[u].pb({v,w});
a[v].pb({u,w});
}
forr (i,0,n - 1)
d[i] = {oo,oo};
forr (i,1,k)
cin >> u, q.push({0,u}),d[u] = {0,0};
while (!q.empty()){
pii u = q.top();
q.pop();
if (u.st != d[u.nd].nd)
continue;
//cout << u.st << " " << u.nd << "\n";
for (pll v : a[u.nd]){
ll cost = u.st + v.nd;
//cout << cost << "\n";
if (cost < d[v.st].st){
d[v.st] = {cost,d[v.st].st};
if (d[v.st].nd != oo)
q.push({d[v.st].nd,v.st});
}
else if (cost < d[v.st].nd){
d[v.st].nd = cost;
q.push({cost,v.st});
}
}
}
cout << d[0].nd;
return 0;
}
/*
*/
Compilation message
/usr/bin/ld: /tmp/ccqgAUck.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccWPBTUi.o:crocodile.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccqgAUck.o: in function `main':
grader.cpp:(.text.startup+0x36): undefined reference to `travel_plan(int, int, int (*) [2], int*, int, int*)'
collect2: error: ld returned 1 exit status