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> A[1001];
int Dist;
void findRoute (int N, int a, int b)
{
int i, j, k;
Dist=ping(a,b);
for(i=1 ; i<=N ; i++)
if(i!=a && i!=b)
{
k=ping(i,b);
if(k<Dist)
A[Dist-k].push_back(i);
}
for(i=1 ; i<=Dist ; i++)
{
k=A[i].size();
for(j=0 ; j<k ; j++)
if(ping(a,A[i][j])==0)
{
travelTo(A[i][j]);
a=A[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... |