Submission #71624

#TimeUsernameProblemLanguageResultExecution timeMemory
71624mr_bananaTowns (IOI15_towns)C++17
0 / 100
28 ms928 KiB
#include <iostream> #include "towns.h" using namespace std; const int MN=200,inf=1e9; int dist[MN][MN]; bool mark[MN][MN]; int n; int getdists(int x){ int mi=0; for(int i=0;i<n;i++){ if(!mark[x][i]){ dist[x][i]=dist[i][x]=getDistance(x,i); mark[x][i]=mark[i][x]=1; } if(dist[x][i]>dist[x][mi]){ mi=i; } } return mi; } int hubDistance(int N, int sub) { n=N; int u=getdists(0); int v=getdists(u); int ans=inf; for(int i=0;i<n;i++){ int d=(dist[i][v]+dist[i][u]-dist[u][v])/2; ans=min(ans,max(dist[i][v],dist[i][u])-d); } return ans; }

Compilation message (stderr)

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:21:28: 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...