| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 108391 | PeppaPig | 악어의 지하 도시 (IOI11_crocodile) | C++14 | 950 ms | 84336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include <bits/stdc++.h>
#define long long long
#define pii pair<long, long>
#define x first
#define y second
using namespace std;
const int N = 1e5+5;
int chk[N];
vector<pii> g[N];
int travel_plan(int n, int m, int r[][2], int l[], int k, int p[]) {
for(int i = 0; i < m; i++) {
int a = r[i][0], b = r[i][1], c = l[i];
g[a].emplace_back(b, c);
g[b].emplace_back(a, c);
}
priority_queue<pii, vector<pii>, greater<pii> > Q;
for(int i = 0; i < k; i++) {
chk[p[i]] = 1;
Q.emplace(0, p[i]);
}
while(!Q.empty()) {
pii now = Q.top(); Q.pop();
++chk[now.y];
if(chk[now.y] != 2) continue;
if(!now.y) return now.x;
for(pii v : g[now.y]) if(chk[v.x] < 2)
Q.emplace(now.x + v.y, v.x);
}
}
컴파일 시 표준 에러 (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... | ||||
