답안 #985072

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
985072 2024-05-17T10:23:51 Z reverberation 사이버랜드 (APIO23_cyberland) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define fs first
#define sc second
#define pb push_back
double solve(ll n, ll m, ll k, ll h, vector<ll> x, vector<ll> y, vector<ll> c, vector<ll> v) {
    vector<vector<pll>> g(n + 1);
    for (ll i = 0; i < m; i++) {
        ll a = x[i] + 1, b = y[i] + 1, cost = c[i];
        g[a].pb({b, cost});
        g[b].pb({a, cost});
    }
    vector<ll> dist(n + 1, 1e9 + 10);
    dist[1] = 0;
    priority_queue<pll, vector<pll>, greater<pll>> q;
    q.push({0, 1});
    while (!q.empty()) {
        auto [curcost, v] = q.top();
        q.pop();
        if (curcost != dist[v]) continue;
        for (auto [to, cost] : g[v]) {
            if (dist[to] > dist[v] + cost) {
                dist[to] = dist[v] + cost;
                q.push({dist[to], to});
            }
        }
    }
    return dist[h];
}

Compilation message

/usr/bin/ld: /tmp/ccKs0JZD.o: in function `main':
grader.cpp:(.text.startup+0x696): undefined reference to `solve(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status