# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
823844 | irmuun | Computer Network (BOI14_network) | C++17 | 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<bits/stdc++.h>
#include "network.h"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
void findRoute(ll N,ll a,ll b){
vector<ll>route;
ll dist=ping(a,b);
dist++;
vector<ll>v(dist);
for(ll i=1;i<=N;i++){
if(a==i||b==i) continue;
ll x=ping(a,i),y=ping(b,i);
x++,y++;
if(x+y==dist){
v[x-1]=i;
}
}
v[dist-1]=b;
for(ll i=0;i<dist;i++){
travelTo(v[i]);
}
}