# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
976537 | marinaluca | 악어의 지하 도시 (IOI11_crocodile) | C++17 | 414 ms | 72256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "crocodile.h"
using namespace std;
int travel_plan(int N, int M, int R[][2], int L[], int k, int P[]){
vector <vector<pair<int, int>>> ans(N);
for (int i = 0; i < M; ++ i){
int a = R[i][0], b = R[i][1];
ans[a].emplace_back(b, L[i]);
ans[b].emplace_back(a, L[i]);
}
vector <int> v(N);
priority_queue<pair<int, int>> pq;
for (int i = 0; i < k; ++ i){
v[P[i]] ++;
pq.emplace(0, P[i]);
}
while (!pq.empty()){
auto [x, y] = pq.top();
pq.pop();
if (v[y] ++ == 1){
if (y == 0)
return -x;
for (auto &[xx, yy] : ans[y]){
pq.emplace(x - yy, xx);
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |