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> node[1000];
void findRoute (int N, int a, int b)
{
int nowPing;
for(int i=1;i<=N;i++)
{
if(i==b) continue;
int res=ping(i,b);
node[res].push_back(i);
if(i==a) nowPing=res;
}
int now=a;
while(nowPing)
{
for(int i=0;i<node[nowPing-1].size();i++)
{
int dest=node[nowPing-1][i];
int res=ping(now,dest);
if(res==0)
{
travelTo(dest);
now=dest;
nowPing--;
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... |