Submission #96553

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
965532019-02-10 09:26:46janlivensTowns (IOI15_towns)C++14
0 / 100
22 ms540 KiB
// This Program is made by Jan(Codezebra)
#include<bits/stdc++.h>
#include "towns.h"
using namespace std;
int hubDistance(int n,int sub){
// int dist[n][n];
if(sub<3){
int mx=0,my=0,ma=0;
for(int i=0;i<n;i++){
// dist[0][i]=getDistance(0,i);
// dist[i][0]=dist[0][i];
if(getDistance(i,0)>ma){
mx=i;
}
}
ma=0;
for(int i=0;i<n;i++){
// dist[mx][i]=getDistance(mx,i);
// dist[i][my]=dist[my][i];
if(getDistance(i,mx)>ma){
my=i;
}
}
int ans=1e7;
for(int i=0;i<n;i++){
int a=getDistance(i,mx),b=getDistance(my,mx),c=getDistance(i,my);
ans=min(ans,max(a+b-c,max(a-b+c,-a+b+c)));
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...