# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127541 | kingfran1907 | Towns (IOI15_towns) | C++14 | 21 ms | 1156 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 "towns.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 150;
const int inf = 0x3f3f3f3f;
int qs[maxn][maxn];
int deb = 0;
int n;
int query(int a, int b) {
assert(a < n && b < n && a >= 0 && b >= 0);
if (a > b) swap(a, b);
if (qs[a][b] == -1) qs[a][b] = getDistance(a, b);
return qs[a][b];
}
int a, b;
int B;
bool subtree(int x, int y) {
int xd = (query(a, x) + query(b, x) - query(a, b)) / 2;
int yd = (query(a, y) + query(b, y) - query(a, b)) / 2;
return (xd + yd) > query(x, y);
}
int hubDistance(int n, int sub) {
deb++;
//for (int i = 0; i < n * n; i++) getdistance(0, 1);
::n = n;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |