Submission #967056

#TimeUsernameProblemLanguageResultExecution timeMemory
967056SyriusCyberland (APIO23_cyberland)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; // #define int long long #define ll long long #define ff first #define ss second #define pint pair < ll , ll > #define vint vector < ll > #define fast ios_base::sync_with_stdio(NULL); cin.tie(NULL) const int inf = 1e9 + 9; const int mxn = 2e5 + 2; const int mod = 1e9 + 7; vector < vector < pint > > adj(mxn); ll dis[mxn]; double solve(int n , int m , int k , int H , vint x , vint y , vint c , vint arr) { for (int i = 0; i < n; i++) { adj[i].clear(); dis[i] = inf; } for (int 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 < pint > q; q.push({0 , 0}); while (!q.empty()) { pint p = q.top(); q.pop(); if (dis[p.ss] != inf) continue; dis[p.ss] = -p.ff; if (p.ss == H) return dis[H]; for (pint i : adj[p.ss]) { q.push({p.ff - i.ss , i.ff}); } } return -1; } // int main() { // int n , m , k , h; // cin >> n >> m >> k >> h; // vint x(m) , y(m) , c(m) , arr(n); // for (int i = 0; i < m; i++) cin >> x[i]; // for (int i = 0; i < m; i++) cin >> y[i]; // for (int i = 0; i < m; i++) cin >> c[i]; // for (int i = 0; i < n; i++) cin >> arr[i]; // cout << solve(n , m , k , h , x , y , c , arr) << '\n'; // }

Compilation message (stderr)

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