# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
12931 | gs14004 | Computer Network (BOI14_network) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <vector>
using namespace std;
vector<int> dist[1001];
int findRoute(int N, int a, int b){
int l = ping(a,b) + 1;
for(int i=1; i<=N; i++){
int l2 = ping(b,i) + 1;
if(l <= l2) continue;
dist[l - l2].push_back(i);
}
int p = a;
for(int i=1; i<=l; i++){
for(int j=0; j<dist[i].size(); j++){
if(ping(p,dist[i][j]) == 0){
travelTo(dist[i][j]);
p = dist[i][j];
}
}
}
}