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>
using namespace std;
vector<int> lis[1100];
void findRoute (int N, int a, int b) {
int dist = ping(a, b)+1, i, j;
for (i=1;i<=N;i++) {
if (i==a||i==b) continue;
int tmp = ping(i,b);
lis[tmp+1].push_back(i);
}
int here = a;
for (i=dist-1;i>0;i--) {
for (j=0;j<lis[i].size();j++) {
if (ping(here,lis[i][j])==0) {
travelTo(lis[i][j]);
here=lis[i][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... |