Submission #16267

#TimeUsernameProblemLanguageResultExecution timeMemory
16267eaststarComputer Network (BOI14_network)C++14
100 / 100
160 ms5076 KiB
#include "network.h" int d[1010],ans[1010]; void findRoute(int n,int a,int b){ int i,j,D; for(i=1;i<=n;++i)if(i!=a)d[i]=ping(a,i)+1; ans[D=d[b]]=b; for(i=d[b]-1;i;--i){ for(j=1;j<=n;++j)if(d[j]==i&&!ping(b,j)){ ans[i]=b=j; break; } } for(i=1;i<=D;++i)travelTo(ans[i]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...