# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151883 | Ruxandra985 | Computer Network (BOI14_network) | C++14 | 115 ms | 7388 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 <cstdio>
#include "network.h"
void findRoute (int n,int a,int b){
int da[n+1],db[n+1];
int i,curr,x,y,xn,yn,nxt;
for (i=1;i<=n;i++){
if (i!=a)
da[i] = ping (a,i);
if (i!=b)
db[i] = ping (b,i);
}
curr = a;
x = -1;
y = da[b];
while (curr!=b){
int more = 0;
for (i=1;i<=n;i++){
if (i!=curr){
if (i!=b){
xn = da[i];
yn = db[i];
}
else {
xn = da[i];
yn = -1;
}
if (x+1 == xn && y-1 == yn){
if (!more)
nxt = i;
else {
if (ping(curr,nxt)==0)
break;
else nxt = i;
}
more = 1;
}
}
}
travelTo(nxt);
curr = nxt;
x++;
y--;
}
}
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... |