제출 #1141492

#제출 시각아이디문제언어결과실행 시간메모리
1141492aarb_.tomatexdTowns (IOI15_towns)C++20
컴파일 에러
0 ms0 KiB
#include "towns.h" #include <bits/stdc++.h> #define ll long long #define SZ(x) ((int)(x).size()) using namespace std; int hubDistance(int N, int sub) { int a = -1; int maxd = -1; //dist a 0 for (int i = 0; i < N; i++) { int kkk = getDistance(0, i); if (kkk > maxd) { a = i; maxd = cdist; } } int b = -1; maxd = -1; //dist al dist de 0 vector<int> dist1(N, -1); for (int i = 0; i < N; i++) { dist1[i] = getDistance(a, i); if (dist1[i] > maxd) { b = i; maxd = dist1[i]; } } //dist al dist del dist del 0 vector<int> dist2(N, -1); for (int i = 0; i < N; i++) { dist2[i] = getDistance(b, i); } int dia = dist1[b]; int ans = 1e9; //centro //cota machin, en como 3 n for (int i = 0; i < N; i++) { int s = (dia + abs(dist1[i] - dist2[i])) / 2; ans = min(ans, s); } return ans; }

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:15:32: error: 'cdist' was not declared in this scope
   15 |                         maxd = cdist;
      |                                ^~~~~