Submission #18412

#TimeUsernameProblemLanguageResultExecution timeMemory
18412tlwpdusComputer Network (BOI14_network)C++98
100 / 100
146 ms5220 KiB
#include "network.h" #include <vector> using namespace std; vector<int> lis[1100]; void findRoute (int N, int a, int b) { int dist = ping(a, b)+1, i, j; for (i=1;i<=N;i++) { if (i==a||i==b) continue; int tmp = ping(i,b); lis[tmp+1].push_back(i); } int here = a; for (i=dist-1;i>0;i--) { for (j=0;j<lis[i].size();j++) { if (ping(here,lis[i][j])==0) { travelTo(lis[i][j]); here=lis[i][j]; break; } } } travelTo(b); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...