# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
587533 | benson1029 | Towns (IOI15_towns) | C++14 | 24 ms | 980 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;
int dis[200][200];
int hubDistance(int N, int sub) {
for(int i=0; i<N; i++) {
for(int j=i+1; j<N; j++) {
dis[i][j] = dis[j][i] = getDistance(i, j);
}
}
int ans = 0;
for(int i=0; i<N; i++) {
for(int j=i+1; j<N; j++) {
for(int k=j+1; k<N; k++) {
int sum = (dis[i][j] + dis[j][k] + dis[i][k]) / 2;
ans = max(ans, sum - dis[i][j]);
ans = max(ans, sum - dis[j][k]);
ans = max(ans, sum - dis[i][k]);
}
}
}
return ans;
}
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... |