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;
#define MAXN 1003
int N, A, B;
int D[MAXN], E[MAXN];
void findRoute (int n, int a, int b)
{
N = n, A = a, B = b;
for (int i=1;i<=N;i++){
D[i] = (A == i ? 0 : ping(A, i) + 1);
E[i] = (B == i ? 0 : ping(B, i) + 1);
}
vector <int> arr;
for (int i=1;i<=N;i++) if (D[i]+E[i] == D[B]) arr.push_back(i);
sort(arr.begin(), arr.end(), [](const int &a, const int &b){
return D[a] < D[b];
});
for (int i=1;i<arr.size();i++) printf("%d\n", arr[i]);
for (int i=1;i<arr.size();i++) travelTo(arr[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... |