Submission #96550

#TimeUsernameProblemLanguageResultExecution timeMemory
96550janlivensTowns (IOI15_towns)C++14
0 / 100
28 ms888 KiB
// This Program is made by Jan(Codezebra) #include<bits/stdc++.h> #include "towns.h" #define INF 0x3f3f3f3f using namespace std; int hubDistance(int n,int sub){ int dist[n][n]; int mx=0,my=0,ma=0; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ dist[i][j]=getDistance(i,j); dist[j][i]=dist[i][j]; if(dist[i][j]>ma){ mx=i; my=j; ma=dist[i][j]; } } } int ans=INF; for(int i=0;i<n;i++){ int a=dist[mx][my],b=dist[mx][i],c=dist[my][i]; ans=min(ans,max(a+b-c,max(a-b+c,-a+b+c))); } return ans; }

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:7:27: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int n,int sub){
                           ^~~
#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...