Submission #5982

#TimeUsernameProblemLanguageResultExecution timeMemory
5982baneling100Computer Network (BOI14_network)C++98
100 / 100
116 ms5220 KiB
#include "network.h" #include <vector> using namespace std; vector <int> A[1001]; int Dist; void findRoute (int N, int a, int b) { int i, j, k; Dist=ping(a,b); for(i=1 ; i<=N ; i++) if(i!=a && i!=b) { k=ping(i,b); if(k<Dist) A[Dist-k].push_back(i); } for(i=1 ; i<=Dist ; i++) { k=A[i].size(); for(j=0 ; j<k ; j++) if(ping(a,A[i][j])==0) { travelTo(A[i][j]); a=A[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...