# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007346 | Ludissey | Computer Network (BOI14_network) | C++14 | 0 ms | 0 KiB |
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>
#define int long long
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
using namespace std;
void findRoute (int N, int a, int b)
{
int d=ping(a,b);
vector<vector<int>> prox(d);
for (int i = 0; i < N; i++) { if(i!=a&&i!=b) prox[ping(i,b)].push_back(i); }
int x=a;
for (int i = 0; i < d; i++){
for (auto u : prox[i])
{
if(ping(x,u)) { x=u; travelTo(x); break;}
}
}
}