제출 #71631

#제출 시각아이디문제언어결과실행 시간메모리
71631mr_banana도시들 (IOI15_towns)C++17
25 / 100
37 ms2356 KiB
#include <bits/stdc++.h> #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(x!=i && !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) { memset(mark,0,sizeof mark); n=N; int u=getdists(0); int v=getdists(u); getdists(v); 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; }

컴파일 시 표준 에러 (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...