답안 #706699

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
706699 2023-03-07T11:59:44 Z Trisanu_Das 관광 (NOI14_sightseeing) C++17
컴파일 오류
0 ms 0 KB
#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++) {
      |                      ^