# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
786062 | KN200711 | Crocodile's Underground City (IOI11_crocodile) | C++14 | 413 ms | 100968 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
# include <bits/stdc++.h>
# define ll long long
# define fi first
# define se second
using namespace std;
bool vis[100001], ct[100001];
ll nw[100001];
vector<pair<int, ll> > edge[100001];
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]) {
for(int i=0;i<N;i++) {
vis[i] = 0;
ct[i] = 0;
edge[i].clear();
}
for(int i=0;i<M;i++) {
edge[R[i][0]].push_back(make_pair(R[i][1], L[i]));
edge[R[i][1]].push_back(make_pair(R[i][0], L[i]));
}
for(int i=0;i<K;i++) vis[P[i]] = 1;
priority_queue< pair<ll, int> > PQ;
for(int i=0;i<K;i++) {
for(int c=0;c<edge[P[i]].size();c++) {
PQ.push(make_pair(-edge[P[i]][c].se, edge[P[i]][c].fi));
}
}
while(!PQ.empty()) {
ll a = -PQ.top().fi;
int b = PQ.top().se;
PQ.pop();
if(vis[0]) break;
if(vis[b]) continue;
if(ct[b]) {
nw[b] = a;
vis[b] = 1;
for(int k=0;k<edge[b].size();k++) {
if(!vis[edge[b][k].fi]) PQ.push(make_pair(-a-edge[b][k].se, edge[b][k].fi));
}
} else ct[b] = 1;
}
return nw[0];
}
컴파일 시 표준 에러 (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... |