#include <bits/stdc++.h>
using namespace std;
int main() {
int v, e, q; cin >> v >> e >> q;
vector<pair<int, int> > adj[v + 1];
for(int e = 1; e <= E; e++) {
int u, v, w;
cin >> u >> v >> w;
adj[u].push_back({w, v});
adj[v].push_back({w, u});
}
set<pair<int, int> > tbv;
vector<int> dp(v + 1, 0);
dp[1] = 1e9 + 1;
tbv.insert({dp[1], 1});
while(!tbv.empty()){
int u = tbv.rbegin()->second;
tbv.erase(*tbv.rbegin());
for(pair<int, int> v : adj[u]) {
int quality = min(v.first, dp[u]);
if(quality > dp[v.second]) {
dp[v.second] = quality;
tbv.insert({dp[v.second], v.second});
}
}
}
while(q--){
int X; cin >> X; cout << dp[X] << '\n';
}
}
Compilation message
sightseeing.cpp: In function 'int main()':
sightseeing.cpp:8:22: error: 'E' was not declared in this scope
8 | for(int e = 1; e <= E; e++) {
| ^