# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
813148 | LIF | Towns (IOI15_towns) | C++14 | 11 ms | 1236 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[1005][1005];
int hubDistance(int N, int sub) {
for(int i=0;i<N;i++)dis[i][i] = 0;
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)
{
dis[i][j] = getDistance(i,j);
dis[j][i] = dis[i][j];
}
}
int minn = 1e9;
int ans1,ans2;
for(int i=0;i<N;i++)
{
int maxn = -1;
for(int j=0;j<N;j++)maxn = max(maxn,dis[i][j]);
if(maxn <= minn)
{
minn = maxn;
ans1 = minn;
ans2 = i;
}
}
if(sub == 1 || sub == 2)return ans1;
else return ans2;
}
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... |