제출 #1018703

#제출 시각아이디문제언어결과실행 시간메모리
1018703parsadox2도시들 (IOI15_towns)C++17
25 / 100
14 ms1028 KiB
#include "towns.h" #include <bits/stdc++.h> #define F first #define S second using namespace std; const int N = 1e2 + 20; int n , dis[N][N]; int hubDistance(int nn , int sub) { n = nn; pair <int , int> D = make_pair(0 , 1); for(int i = 1 ; i < n ; i++) { dis[0][i] = dis[i][0] = getDistance(0 , i); if(dis[0][i] > dis[D.F][D.S]) D = make_pair(0 , i); } for(int i = 0 ; i < n ; i++) if(i != D.S) { dis[i][D.S] = dis[D.S][i] = getDistance(i , D.S); if(dis[i][D.S] > dis[D.F][D.S]) D = make_pair(i , D.S); } int ans = dis[D.F][D.S]; for(int x = 0 ; x < n ; x++) { dis[x][D.F] = dis[D.F][x] = getDistance(x , D.F); int r = (dis[x][D.F] + dis[x][D.S] - dis[D.F][D.S]) / 2; ans = min(ans , max(dis[x][D.F] , dis[x][D.S]) - r); } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:12:30: warning: unused parameter 'sub' [-Wunused-parameter]
   12 | int hubDistance(int nn , 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...