# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300977 | zecookiez | Computer Network (BOI14_network) | C++14 | 134 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 <bits/stdc++.h>
#include <network.h>
using namespace std;
template<class C>constexpr int len(const C&c){return int(c.size());}
const int MAXN = 1001;
vector<int> dist[MAXN];
void findRoute(int N, int a, int b){
int c = ping(a, b); dist[c].push_back(b);
for(int v, i = 1; i <= N; ++i){
if(i == a) continue;
v = i == b ? c : ping(a, i);
if(v < c) dist[v].push_back(i);
}
int prev = a;
for(int x = 0; x < c; ++x){
for(int nxt : dist[x]){
if(x + 1 + ping(nxt, b) == c && ping(prev, nxt) == 0){
travelTo(nxt); prev = nxt;
break;
}
}
}
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... |