# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
713949 | Stickfish | Computer Network (BOI14_network) | C++17 | 110 ms | 7996 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 <vector>
using namespace std;
void findRoute (int N, int a, int b) {
vector<int> depth(N + 1);
vector<vector<int>> rdepth(N);
for (int i = 1; i <= N; ++i) {
if (i != b)
depth[i] = ping(i, b) + 1;
rdepth[depth[i]].push_back(i);
}
int v = a;
while (v != b) {
for (auto u : rdepth[depth[v] - 1]) {
if (ping(v, u) + 1 == 1) {
v = u;
travelTo(v);
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... |