Submission #985125

# Submission time Handle Problem Language Result Execution time Memory
985125 2024-05-17T10:56:37 Z SabyrAl Cyberland (APIO23_cyberland) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;

double djicstra(int n, int m, int k, int h, vector<vector<pll> >& g) {
    vector<ll> dist(n, 1e15);
    dist[0] = 0;
    priority_queue<pll, vector<pll >, greater<pll > > q;
    q.push({0, 0});
    while(!q.empty()) {
        auto [d, v] = q.top();
        q.pop();
        if (d != dist[v]) continue;
        for (auto [to, c] : g[v]) {
            q.push({c + d, to});
            dist[to] = min(c + d, dist[to]);
        }
    }
    return dist[h];
}

double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) {
    vector<vector<pll > > g(N);
    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]});
    }
    return djicstra(N, M, K, H, g);
}


signed main() {
    cout << solve(7, 6, 10, 6, {0 , 0, 1, 1, 2 , 2}, {1, 2, 3, 4 , 5, 6}, {1, 2, 3, 4, 5, 6}, {1, 1, 1, 1, 1, 1}) << '\n';

    return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccJMKtRQ.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccNxg2GQ.o:cyberland.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status