제출 #1082738

#제출 시각아이디문제언어결과실행 시간메모리
1082738vjudge1도시들 (IOI15_towns)C++17
0 / 100
11 ms1372 KiB
#include "towns.h" #include <bits/stdc++.h> using namespace std; const int N = 500; int memo[N][N]; int dist(int u,int v){ if(u == v)return 0; if(u > v)swap(u, v); if(memo[u][v] != -1)return memo[u][v]; return memo[u][v] = getDistance(u, v); } int hubDistance(int n, int sub) { memset(memo, -1, sizeof memo); int u = 0; for(int i = 1;i < n;i++){ if(dist(i, 0) > dist(u, 0))u = i; } int v = 0; for(int i = 1;i < n;i++){ if(dist(i, u) > dist(v, u))v = i; } return dist(u, v); }

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

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