| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1359306 | jump | 관광 (NOI14_sightseeing) | C++20 | 1302 ms | 164264 KiB |
#include <bits/stdc++.h>
int v,e,q;
int dist[500010];
std::vector<std::pair<int,int>> adj[500010];
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cin >> v >> e >> q;
for(int i=1;i<=e;i++){
int a,b,w;
std::cin >> a >> b >> w;
adj[a].push_back({b,w});
adj[b].push_back({a,w});
}
std::priority_queue<std::pair<int,int>> pq;
pq.push({1e18,1});
dist[1]=1e18;
while(!pq.empty()){
int qual = pq.top().first;
int node = pq.top().second;
pq.pop();
for(auto [to,parq]:adj[node]){
if(dist[to]<std::min(parq,qual)){
dist[to]=std::min(parq,qual);
pq.push({dist[to],to});
}
}
}
while(q--){
int ask;
std::cin >> ask;
std::cout << dist[ask] << '\n';
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
