# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
823974 | 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(int n,int a,int b){
vector<int>v[n+1];
v[0].pb(b);
int hi;
for(int i=1;i<=n;i++){
if(i==b) continue;
int x=ping(i,b);
v[x].pb(i);
if(i==a) hi=x;
}
while(hi){
for(auto i:adj[hi-1]){
if(ping(a,i)==0){
travelTo(i);
hi--;
a=i;
break;
}
}
}
}