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 d[1010],ans[1010];
void findRoute(int n,int a,int b){
int i,j,D;
for(i=1;i<=n;++i)if(i!=a)d[i]=ping(a,i)+1;
ans[D=d[b]]=b;
for(i=d[b]-1;i;--i){
for(j=1;j<=n;++j)if(d[j]==i&&!ping(b,j)){
ans[i]=b=j;
break;
}
}
for(i=1;i<=D;++i)travelTo(ans[i]);
}
# | 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... |