# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154154 | nicolaalexandra | Computer Network (BOI14_network) | C++14 | 125 ms | 8184 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 <iostream>
#include "network.h"
#include <cstring>
using namespace std;
int f[1010];
/*void travelTo (int x){
cout<<x<<" ";
}
int ping (int a, int b){ /// dist minima de la a la b
cout<<"? "<<a<<" "<<b<<endl;
int ans;
cin>>ans;
return ans;
}*/
void findRoute (int n, int a, int b){
memset (f,0,sizeof f);
int dist = ping (a,b);
int nod = a;
f[a] = 1;
for (;;){
dist--;
if (dist == -1){
travelTo(b);
break;
}
for (int i=1;i<=n;i++){
if (f[i])
continue;
if (ping(nod,i) == 0 && ping (i,b) == dist){
travelTo(i);
nod = i;
f[nod] = 1;
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... |