Submission #345065

#TimeUsernameProblemLanguageResultExecution timeMemory
345065daniel920712경주 (Race) (IOI11_race)C++14
Compilation error
0 ms0 KiB
#include "race.h" #include <vector> #include <utility> using namespace std; long long ans=1000000000; vector < pair < long long , long long > > Next[200005]; void F(long long fa,long long here,long long dis,long long deg,long long K) { if(dis==K) ans=min(ans,deg); if(dis>=K) return ; for(auto i:Next[here]) if(i.first!=fa) F(here,i.first,dis+i.second,deg+1,K); } int best_path(long long N, long long K, long long H[][2], long long L[]) { long long i; for(i=1;i<N;i++) { Next[H[i][0]].push_back(make_pair(H[i][1],L[i])); Next[H[i][1]].push_back(make_pair(H[i][0],L[i])); } for(i=0;i<N;i++) F(-1,i,0,0,K); if(ans==1000000000) ans=-1; return (int) ans; }

Compilation message (stderr)

/tmp/ccyjv92V.o: In function `main':
grader.cpp:(.text.startup+0x24): undefined reference to `best_path(int, int, int (*) [2], int*)'
collect2: error: ld returned 1 exit status