Submission #1179240

#TimeUsernameProblemLanguageResultExecution timeMemory
1179240stdfloat사이버랜드 (APIO23_cyberland)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "cyberland.h"
#include "stub.cpp"
using namespace std;

#define ff    first
#define ss    second
#define pii   pair<int, int>

double solve(int n, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> a) {
    K = min(K + 1, 60);

    vector<pii> E[n];
    for (int i = 0; i < M; i++) {
        E[x[i]].push_back({y[i], c[i]});
        E[y[i]].push_back({x[i], c[i]});
    }

    double ans = 1e18;
    vector<double> dis(n, 1e18);
    priority_queue<pair<double, int>> pq;
    dis[0] = 0; pq.push({0, 0});
    while (K--) {
        vector<double> ndis(n, 1e18);
        priority_queue<pair<double, int>> npq;
        while (!pq.empty()) {
            auto [d, x] = pq.top(); d = -d; pq.pop();
        
            if (x == H || abs(d - dis[x]) > 1e-18) continue;

            for (auto [i, w] : E[x]) {
                double nd = (!a[i] ? 0 : d + w);

                if (nd < dis[i]) {
                    dis[i] = nd;
                    pq.push({-nd, i});
                }
                if (a[i] == 2 && nd < 2 * ndis[i]) {
                    ndis[i] = nd / 2;
                    npq.push({-(nd / 2), i});
                }
            }
        }

        ans = min(ans, dis[H]);
        pq = npq;
        dis = ndis;
    }

    return (1e18 - ans < 1e-18 ? -1 : ans);
}

Compilation message (stderr)

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