# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65737 | MiricaMatei | Computer Network (BOI14_network) | C++14 | 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 "network.h"
#include <vector>
vector<int>d[1005];
void findRoute (int N, int a, int b)
{
int dist;
for (int i = 1; i <= n; ++i) {
if (i == b)
continue;
int x = ping(b, i);
if (i == a)
dist = x;
d[x].push_back(i);
}
while (a != b) {
dist--;
for (auto it:d[dist])
if (ping(it, a) == 1) {
travelTo(it);
a = it;
break;
}
}
}