# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397596 | lyc | Computer Network (BOI14_network) | C++14 | 119 ms | 7900 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;
int _ping(int a, int b) {
if (a == b) return -1;
return ping(a,b);
}
void findRoute (int N, int a, int b)
{
int dist[N+1];
for (int i = 1; i <= N; ++i) {
dist[i] = _ping(a,i);
}
vector<int> v = {b};
for (int d = dist[b]-1; d >= 0; --d) {
for (int i = 1; i <= N; ++i) if (dist[i] == d && _ping(v.back(),i) == 0) {
v.push_back(i);
break;
}
}
for (int i = (int)v.size()-1; i >= 0; --i) {
travelTo(v[i]);
}
}
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... |