Submission #639507

#TimeUsernameProblemLanguageResultExecution timeMemory
639507CookieCrocodile's Underground City (IOI11_crocodile)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #include<fstream> #define ll long long #define vt vector #define pb push_back #define fi first #define se second #define forr(i, a, b) for(int i = a; i < b; i++) #define dorr(i, a, b) for(int i = a; i >= b; i--) typedef unsigned long long ull; #define pii pair<int, int> const ll mod = 1e9 + 7; #define int long long #include<fstream> ifstream fin("timeline.in"); ofstream fout("timeline.out"); const int mxn = 1e5; const int inf = 1e9 + 3; vt<pii>adj[mxn + 1]; pii d[mxn + 1]; // best and second best struct ch{ int u, d; }; struct cmp{ bool operator()(ch a, ch b){ return(a.d > b.d); } }; int n, m, k; int r[10][2], l[10], p[10]; int travel_plan(int n, int m, int r[][2], int l[], int k, int p[]){ for(int i = 0; i < n; i++){ d[i].fi = d[i].se = inf; } for(int i = 0; i < m; i++){ int u = r[i][0], v = r[i][1], w = l[i]; adj[u].pb({v, w}); adj[v].pb({u, w}); } priority_queue<ch, vt<ch>, cmp>pq; for(int i = 0; i < k; i++){ d[p[i]].fi = d[p[i]].se = 0; pq.push({p[i], 0}); } while(!pq.empty()){ ch nw = pq.top(); pq.pop(); int u = nw.u, dd = nw.d; if(u == 0){ return(dd); } if(d[u].se != dd)continue; for(auto i: adj[u]){ int v = i.fi, w = i.se; if(dd + w < d[v].se){ d[v].se = dd + w; if(d[v].fi > d[v].se)swap(d[v].fi, d[v].se); if(d[v].se != inf){ pq.push({v, d[v].se}); } } } } return(69); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccGqsNQk.o: in function `main':
grader.cpp:(.text.startup+0x36): undefined reference to `travel_plan(int, int, int (*) [2], int*, int, int*)'
collect2: error: ld returned 1 exit status