# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132402 | reda | Towns (IOI15_towns) | C++14 | 21 ms | 1016 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 sub )
{
int m[n][n], s, t, maxd = -1;
for(int i = 0; i < n; i++)
{
m[i][i] = 0;
for( int j = i+1; j < n; j++ )
{
m[i][j] = getDistance(i,j);
m[j][i] = m[i][j];
if( m[i][j] > maxd )
{
s = i;
t = j;
maxd = m[i][j];
}
}
}
int R = 1e9+1;
for(int i = 0; i < n; ++i )
{
if(i==s || i==t)continue ;
int z = (m[i][t] - m[i][s] - maxd)/-2;
int x = maxd - z;
int y = m[i][s] - z;
R = min(R, max(x, z));
}
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... |