# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752460 | salmon | Computer Network (BOI14_network) | C++14 | 76 ms | 4192 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 <bits/stdc++.h>
using namespace std;
void findRoute (int N, int a, int b){
int dist[N + 5];
vector<pair<int,int>> v;
for(int i = 1; i < N; i++){
if(i != a && i != b){
dist[i] = ping(i,b) + 1;
v.push_back(make_pair(dist[i],i));
}
else{
dist[i] = 10000;
}
}
int d = N;
sort(v.begin(),v.end(),greater<pair<int,int>>());
for(int i = 0; i < N - 1; i++){
if(v[i].first == d){
continue;
}
if(ping(v[i].second,a) == 1){
a = v[i].second;
d--;
travelTo(a);
}
}
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... |