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"
int da[2005], db[2005];
void findRoute(int N, int a, int b) {
int dist = ping(a, b);
for (int i = 1; i <= N; i++) if (i != a) da[i] = ping(a, i);
for (int i = 1; i <= N; i++) if (i != b) db[i] = ping(b, i);
for (int i = 1; i <= dist; ++i) {
for (int j = 1; j <= N; j++) {
if (j != a && da[j] == i - 1 && db[j] == dist - i) {
travelTo(j);
break;
}
}
}
travelTo(b);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |