# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
310393 | aZvezda | Towns (IOI15_towns) | C++14 | 0 ms | 0 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"
const int MAX_N = 115;
int dist0[MAX_N];
int hubDistance(int N, int sub) {
int mx = 0;
for(int i = 1; i < N; i ++) {
dist0[i] = getDistance(0, i);
if(dist0[i] > dist0[mx]) {
mx = i;
}
}
int R = 0;
for(int i = 0; i < N; i ++) if(i != mx) {
chkmax(R, getDistance(mx, i));
}
return R;
}