# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42634 | XmtosX | Computer Network (BOI14_network) | C++14 | 146 ms | 58644 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>
using namespace std;
void findRoute(int N,int a,int b);
int ping(int i,int j);
void travelTo(int k);
int n,dis[1004];
vector <int> v;
void findRoute(int N,int a,int b)
{
n=N;
for (int i=1;i<=n;i++)
{
if (i==b)
continue;
dis[i]=ping(i,b);
}
int x=dis[a],last=a;
while (x)
{
for (int i=1;i<=n;i++)
{
if (dis[i]==x-1&&ping(i,last)==0)
{
last=i;
x--;
v.push_back(i);
break;
}
}
}
for (int i=0;i<v.size();i++)
{
travelTo(v[i]);
}
travelTo(b);
}
Compilation message (stderr)
# | 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... |