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>
#include "network.h"
#define MN 1000
using namespace std;
vector<int> A[MN+1];
int d[MN+1];
void findRoute(int N,int a,int b){
for(int i=1;i<=N;i++){
if(i!=b){
d[i]=ping(i,b)+1;
}
else{
d[i]=0;
}
A[d[i]].push_back(i);
}
while(a!=b){
for(auto n:A[d[a]-1]){
if(ping(a,n)==0){
travelTo(n);
a=n;
break;
}
}
}
}
# | 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... |