| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 255605 | SamAnd | 악어의 지하 도시 (IOI11_crocodile) | C++17 | 715 ms | 57176 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
const int N = 100005;
const int INF = 1000000009;
struct ban
{
    int x;
    int d;
    ban(){}
    ban(int x, int d)
    {
        this->x = x;
        this->d = d;
    }
};
int n;
vector<ban> g[N];
bool c[N];
int min1[N], min2[N];
bool operator<(const ban& a, const ban& b)
{
    return a.d > b.d;
}
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
    n = N;
    for (int i = 0; i < M; ++i)
    {
        int x = R[i][0];
        int y = R[i][1];
        int z = L[i];
        g[x].push_back(ban(y, z));
        g[y].push_back(ban(x, z));
    }
    for (int x = 0; x < n; ++x)
    {
        min1[x] = min2[x] = INF;
    }
    priority_queue<ban> q;
    for (int i = 0; i < K; ++i)
    {
        int x = P[i];
        min1[x] = min2[x] = 0;
        q.push(ban(x, 0));
    }
    while (!q.empty())
    {
        ban t;
        do
        {
            t = q.top();
            q.pop();
        } while (c[t.x]);
        c[t.x] = true;
        if (t.x == 0)
            return t.d;
        for (int i = 0; i < g[t.x].size(); ++i)
        {
            ban h = g[t.x][i];
            h.d += t.d;
            if (h.d <= min1[h.x])
            {
                min2[h.x] = min1[h.x];
                min1[h.x] = h.d;
            }
            else if (h.d <= min2[h.x])
            {
                min2[h.x] = h.d;
            }
            q.push(ban(h.x, min2[h.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... | ||||
