제출 #1018701

#제출 시각아이디문제언어결과실행 시간메모리
1018701parsadox2도시들 (IOI15_towns)C++17
13 / 100
22 ms1112 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; for(int i = 0 ; i < n ; i++) for(int j = i + 1 ; j < n ; j++) dis[i][j] = dis[j][i] = getDistance(i , j); pair <int , int> D = make_pair(0 , 1); for(int i = 0 ; i < n ; i++) for(int j = i + 1 ; j < n ; j++) if(dis[i][j] > dis[D.F][D.S]) D = make_pair(i , j); int ans = dis[D.F][D.S]; //cout << D.F << " " << D.S << " " << dis[D.F][D.S] << endl; for(int x = 0 ; x < n ; x++) { int r = (dis[x][D.F] + dis[x][D.S] - dis[D.F][D.S]) / 2; //cout << x << " " << r << " " << dis[x][D.F] << " " << dis[x][D.S] << endl; 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...