# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
630178 | NintsiChkhaidze | 악어의 지하 도시 (IOI11_crocodile) | C++14 | 2 ms | 2644 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
#define s second
#define pb push_back
#define f first
const int nn = 100005;
vector <pair<int,int> > v[nn];
int dis[nn];
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]){
for (int i = 0; i < M; i++){
v[R[i][0]].pb({R[i][1],L[i]});
v[R[i][1]].pb({R[i][0],L[i]});
}
for (int i = 1; i < N; i++)
dis[i] = 1e9;
priority_queue< pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> pq;
pq.push({0,0});
dis[0] = 0;
while(pq.size()){
int x = pq.top().s,d = pq.top().f;
pq.pop();
if (dis[x] != d) continue;
for (auto [to,w]: v[x]){
if (dis[to] > d + w){
dis[to] = d + w;
pq.push({dis[to],to});
}
}
}
int ans = 0;
for (int i = 0; i < K; i++)
ans = max(ans, dis[P[i]]);
return ans;
}
컴파일 시 표준 에러 (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... |