제출 #1082737

#제출 시각아이디문제언어결과실행 시간메모리
1082737vjudge1도시들 (IOI15_towns)C++17
0 / 100
11 ms2392 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; } if(sub <= 2)return dist(u, v); else return 'k' + 'e' + 'k'; }
#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...