Submission #361736

#TimeUsernameProblemLanguageResultExecution timeMemory
361736David_MDreaming (IOI13_dreaming)C++14
Compilation error
0 ms0 KiB
//#include "dreaming.h" #include<bits/stdc++.h> using namespace std; int d[3][1<<17],f[1<<17],W[1<<17],w,e,D,X=-1,Y=-1,Z=-1; vector<pair<int,int> >v[1<<17]; void U(int x,int o){ f[x]++; if(o<2&&d[o][x]>=D)e=x,D=d[o][x]; if(o>1)D=min(D,max(d[1][x],d[2][x])); for(auto y:v[x])if(f[y.first]<=o)d[o][y.first]=d[o][x]+y.second,U(y.first,o); } int travelTime(int N,int M,int L,int A[],int B[],int T[]){ while(M--)v[A[M]].push_back({B[M],T[M]}),v[B[M]].push_back({A[M],T[M]}); while(N--)if(!f[N])U(N,0),U(e,1),U(e,2),W[w++]=D,D=0; while(w--){ if(Z<W[w])Z=W[w]; if(Y<W[w])Z=Y,Y=W[w]; if(X<W[w])Y=X,X=W[w]; } return max(X,Z+(Z>=0)*L)+Y+(Y>=0)*L; }

Compilation message (stderr)

/tmp/cchlwk16.o: In function `main':
grader.c:(.text.startup+0xc9): undefined reference to `travelTime'
collect2: error: ld returned 1 exit status