Submission #16057

#TimeUsernameProblemLanguageResultExecution timeMemory
16057tonyjjwComputer Network (BOI14_network)C++14
100 / 100
161 ms5220 KiB
#include<vector> #include "network.h" #define MN 1000 using namespace std; vector<int> A[MN+1]; int d[MN+1]; void findRoute(int N,int a,int b){ for(int i=1;i<=N;i++){ if(i!=b){ d[i]=ping(i,b)+1; } else{ d[i]=0; } A[d[i]].push_back(i); } while(a!=b){ for(auto n:A[d[a]-1]){ if(ping(a,n)==0){ travelTo(n); a=n; break; } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...