# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
511369 | tabr | 악어의 지하 도시 (IOI11_crocodile) | C++17 | 679 ms | 51996 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif
int travel_plan(int n, int m, int r[][2], int l[], int k, int p[]) {
vector<vector<int>> g(n);
for (int i = 0; i < m; i++) {
g[r[i][0]].emplace_back(i);
g[r[i][1]].emplace_back(i);
}
vector<vector<int>> c(n);
vector<int> d(n, (int) 1e9 + 1);
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
for (int i = 0; i < k; i++) {
c[p[i]].emplace_back(0);
c[p[i]].emplace_back(0);
d[p[i]] = 0;
pq.emplace(0, p[i]);
}
while (!pq.empty()) {
auto [e, v] = pq.top();
pq.pop();
if (d[v] != e) {
continue;
}
if (v == 0) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |