제출 #730715

#제출 시각아이디문제언어결과실행 시간메모리
730715Vu_CG_Coder도시들 (IOI15_towns)C++14
0 / 100
38 ms1084 KiB
#include "towns.h" #include <bits/stdc++.h> using namespace std; int hubDistance(int N, int sub) { int n = N; pair <int,int> tmp; vector <int> val; val.assign(n,0); for (int i = 1 ; i < n ; i++){ int x = getDistance(0,i); tmp = max(tmp,make_pair(x,i)); } int u = tmp.second; tmp.first = 0; for (int i = 0 ; i < n ; i++) if (i != u){ int x = getDistance(i,u); val[i] = x; tmp = max(tmp,make_pair(x,i)); } int v = tmp.second; int R = 1e9; for (int i = 0 ; i <= n ; i++) if (i != u && i != v) { int x = getDistance(v,i); int y = val[i]; int z = val[v]; int a = (x + y - z)/2; int b = x - a; int c = z - b; int r = max(a,max(b,c)); R = min(R,r); } return R; }

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

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