Submission #567460

#TimeUsernameProblemLanguageResultExecution timeMemory
567460losmi247Crocodile's Underground City (IOI11_crocodile)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5+45; int n,m,k; vector <pair<int,ll>> g[N]; bool ex[N]; ll dp1[N]; void dfs(int x,int par){ vector <ll> svi; for(auto f : g[x]){ int u = f.first; if(u == par) continue; ll w = f.second; dfs(u,x); svi.push_back(dp1[u]+w); } if(svi.empty()) return; assert(svi.size() >= 2); sort(svi.begin(),svi.end()); dp1[x] = svi[1]; } int zadrvo(){ dfs(1,0); return dp1[1]; } int travel_plan(int br,int M,int **R,int *L,int K,int *P){ n = br; m = M; k = K; for(int i = 0; i < m; i++){ g[R[i][0]+1].push_back({R[i][1]+1,L[i]}); g[R[i][1]+1].push_back({R[i][0]+1,L[i]}); } for(int i = 0; i < k; i++){ ex[P[i]+1] = 1; } return zadrvo(); } /*int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int br1,br2,br3; cin >> br1 >> br2 >> br3; int **grane = new int *[br2]; for(int i = 0; i < br2; i++) grane[i] = new int [2]; int *tezine = new int [br2]; for(int i = 0; i < br2; i++){ cin >> grane[i][0] >> grane[i][1] >> tezine[i]; } int *izlazi = new int [br3]; for(int i = 0; i < br3; i++) cin >> izlazi[i]; cout << travel_plan(br1,br2,grane,tezine,br3,izlazi) << endl; for(int i = 0; i < br2; i++) delete[] grane[i]; delete[] grane; delete[] tezine; delete[] izlazi; }*/

Compilation message (stderr)

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