# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
47315 | ista2000 | Computer Network (BOI14_network) | C++17 | 148 ms | 47668 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;
void findRoute (int n, int a, int b)
{
/*
* Obviously, this is not a good solution.
* Replace it with your own code.
*/
vector<int> v(n);
for(int i = 0;i<n;i++)
if(i!=b-1)
v[i] = ping(i+1, b)+1;
int cur = a-1;
while(cur!=b-1)
{
for(int i = 0;i<n;i++)
{
if(v[i]==v[cur]-1)
{
int x = ping(cur+1, i+1);
if(!x)
{
travelTo(i+1);
cur = i;
break;
}
}
}
}
}
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... |