Submission #15987

#TimeUsernameProblemLanguageResultExecution timeMemory
15987myungwooComputer Network (BOI14_network)C++14
100 / 100
165 ms5728 KiB
#include "network.h" #include <bits/stdc++.h> using namespace std; vector <int> arr[1001]; void findRoute (int N, int A, int B) { int dist = ping(A, B) + 1; for (int i=1;i<=N;i++) if (B != i){ int d = ping(B, i) + 1; if (d >= dist) continue; arr[dist-d].push_back(i); } int p = A; for (int i=1;i<dist;i++) for (int t: arr[i]) if (!ping(p, t)){ travelTo(p = t); 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...