Submission #18618

#TimeUsernameProblemLanguageResultExecution timeMemory
18618mindolComputer Network (BOI14_network)C++14
100 / 100
146 ms5216 KiB
#include "network.h" #include<vector> using namespace std; vector<int> node[1000]; void findRoute (int N, int a, int b) { int nowPing; for(int i=1;i<=N;i++) { if(i==b) continue; int res=ping(i,b); node[res].push_back(i); if(i==a) nowPing=res; } int now=a; while(nowPing) { for(int i=0;i<node[nowPing-1].size();i++) { int dest=node[nowPing-1][i]; int res=ping(now,dest); if(res==0) { travelTo(dest); now=dest; nowPing--; 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...