Submission #967050

#TimeUsernameProblemLanguageResultExecution timeMemory
967050akacool445kCyberland (APIO23_cyberland)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "cyberland.h"
using namespace std;
// #define long long long long
#define ff first
#define ss second
const long long shrek = 1e5;
vector< vector<pair<long long, long long>>> adj(shrek);

double solve(long long n, long long m, long long k, long long h, vector<long long> x, vector<long long> y, vector<long long> c, vector<long long> arr) {
    vector<long long> dist (n + 1);
    for(long long i = 0; i < n; i++) dist[i] = -1;
    for(long long i = 0; i < m; i++) {
        adj[x[i]].push_back({y[i], c[i]});
        adj[y[i]].push_back({x[i], c[i]});
    }
    priority_queue <pair<long long, long long>> q;
    q.push({0, 0});
    while(!q.empty()) {
        pair<long long, long long> p = q.top();
        q.pop();
        if(dist[p.ss] != -1) continue;
        dist[p.ss] = -p.ff;
        for(auto x : adj[p.ss]) {
            q.push({p.ff - x.ss, x.ff});
        }
    }
    return dist[h];
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccRF9iWi.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