# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
105972 | xiaowuc1 | Computer Network (BOI14_network) | C++14 | 175 ms | 8176 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 <algorithm>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <vector>
#include "network.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> pipii;
typedef vector<vector<ll>> matrix;
void findRoute(int N, int a, int b) {
map<int, int> distToB;
for(int i = 1; i <= N; i++) {
if(i == b) distToB[i] = 0;
else distToB[i] = ping(i, b) + 1;
}
int curr = a;
while(curr != b) {
if(distToB[curr] == 1) {
travelTo(b);
break;
}
bool found = false;
for(auto out: distToB) {
if(distToB[curr] == 1 + out.second) {
if(ping(curr, out.first) == 0) {
travelTo(out.first);
curr = out.first;
found = true;
break;
}
}
}
assert(found);
}
}
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... |