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 <bits/stdc++.h>
using namespace std;
vector <int> arr[1001];
void findRoute (int N, int A, int B)
{
int dist = ping(A, B) + 1;
for (int i=1;i<=N;i++) if (B != i){
int d = ping(B, i) + 1;
if (d >= dist) continue;
arr[dist-d].push_back(i);
}
int p = A;
for (int i=1;i<dist;i++)
for (int t: arr[i])
if (!ping(p, t)){ travelTo(p = t); 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... |