# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16066 | paruru | Computer Network (BOI14_network) | C++98 | 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<vector>
using namespace std;
vector<int> V[1200];
int arr[1002];
void findRoute (int N, int a, int b)
{
int t=ping(a,b);
for(int i=1;i<=N;i++)
{
if(i!=a&&i!=b)
{
int k=ping(i,b);
V[k].push_back(i);
}
}
int cur=a;
for(int i=t-1;i>=0;i++)
{
for(int k=0;k<V[i].size();k++)
{
if(ping(cur,V[i][k])==0)
{
cur=V[i][k];
travel_to(V[i][k]);
break;
}
}
}
travel_to(b);
}