답안 #876631

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
876631 2023-11-22T06:27:20 Z dimashhh Examination (JOI19_examination) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "cyberland.h"
using namespace std;
typedef long long ll;
const int N = 1e6 + 1;
vector<pair<int, int>> g[N];
int f, maxn;
double dijkstra(vector<int> &x)
{
    double d[N];
    for (int j = 0; j < maxn; j++)
    {
        d[j] = 1e15;
    }
    set<pair<double, int>> st;
    for (int j : x)
    {
        d[j] = 0;
        st.insert({d[j], j});
    }
    while (!st.empty())
    {
        int v = (*st.begin()).second;
        st.erase({d[v], v});
        for (auto [to, w] : g[v])
        {
            if (d[to] > d[v] + w)
            {
                st.erase({d[to], to});
                d[to] = d[v] + w;
                st.insert({d[to], to});
            }
        }
    }
    return d[f];
}
double solve(int n, int m, int k, int h, std::vector<int> x, std::vector<int> y, std::vector<int> c, std::vector<int> arr)
{
    f = h;
    maxn = n;
    for (int i = 0; i < n; i++)
    {
        g[i].clear();
    }
    for (int i = 0; i < m; i++)
    {
        g[x[i]].push_back({y[i], c[i]});
        g[y[i]].push_back({x[i], c[i]});
    }
    vector<int> vv(1, 0);

    double res = dijkstra(vv);
    if (res == 1e15)
        return -1;
    vv.clear();
    for (int j = 0; j < n; j++)
    {
        if (!arr[j])
        {
            vv.push_back(j);
        }
    }
    return res;
}

Compilation message

examination.cpp:2:10: fatal error: cyberland.h: No such file or directory
    2 | #include "cyberland.h"
      |          ^~~~~~~~~~~~~
compilation terminated.