제출 #310393

#제출 시각아이디문제언어결과실행 시간메모리
310393aZvezdaTowns (IOI15_towns)C++14
컴파일 에러
0 ms0 KiB
#include "towns.h"

const int MAX_N = 115;
int dist0[MAX_N];

int hubDistance(int N, int sub) {
    int mx = 0;
    for(int i = 1; i < N; i ++) {
        dist0[i] = getDistance(0, i);
        if(dist0[i] > dist0[mx]) {
            mx = i;
        }
    }
    int R = 0;
    for(int i = 0; i < N; i ++) if(i != mx) {
        chkmax(R, getDistance(mx, i));
    }
	return R;
}

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

towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:16:9: error: 'chkmax' was not declared in this scope
   16 |         chkmax(R, getDistance(mx, i));
      |         ^~~~~~
towns.cpp:6:28: warning: unused parameter 'sub' [-Wunused-parameter]
    6 | int hubDistance(int N, int sub) {
      |                        ~~~~^~~