Submission #985101

#TimeUsernameProblemLanguageResultExecution timeMemory
985101SabyrAlCyberland (APIO23_cyberland)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; void djicstra(int n, int m, int k, int h, vector<vector<pair<int, int> > >& g, vector<int>& arr) { vector<int> dist(n, 1e9); dist[0] = 0; priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > 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]); } } cout << dist[h] << '\n'; } void solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) { vector<vector<pair<int, int> > > 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]}); } djicstra(N, M, K, H, g, arr); } signed main() { //solve(3, 2, 30, 2, {1, 2}, {2, 0}, {12, 4}, {1, 2, 1}); return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccDAdBco.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccONH9Jp.o:cyberland.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccDAdBco.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