# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
592187 | Deepesson | Towns (IOI15_towns) | C++17 | 17 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 <bits/stdc++.h>
int getDistance(int i, int j);
int hubDistance(int N, int sub);
typedef std::pair<int,int> pii;
pii MaisDistante(int N,int x){
int best=-1,alvo=0;
for(int i=0;i!=N;++i){
if(i==x)continue;
int d = getDistance(i,x);
if(d>best){
best=d;
alvo=i;
}
}
return {best,alvo};
}
int hubDistance(int N, int sub) {
pii alpha = MaisDistante(N,0);
pii beta = MaisDistante(N,alpha.second);
return beta.first/2 + (beta.first&1);
}
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... |