# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
557682 | sidon | Towns (IOI15_towns) | C++17 | 19 ms | 380 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 "towns.h"
using namespace std;
int hubDistance(int N, int _) {
int d[N][N] {}, x {};
for(int i = 1; i < N; ++i)
if((d[0][i] = getDistance(0, i)) > d[0][x])
x = i;
int y = x;
for(int i = 0; i < N; ++i)
if((d[x][i] = getDistance(x, i)) > d[x][y])
y = i;
int R = 1e6;
for(int i = 0; i < N; ++i) {
int c = (d[x][i] - d[0][i] + d[0][x]) / 2;
R = min(R, max(c, d[x][y] - c));
}
return R;
}
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... |