제출 #773861

#제출 시각아이디문제언어결과실행 시간메모리
773861AminjinGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h"
#include<iostream>
using namespace std;


long long findGap(int T, int N)
{
	long long mn, mx, i, j;
	long long a[N+1];

	MinMax(0LL,LLONG_MAX, &mn, &mx);
	a[1] = mn; a[N] = mx;
	i = 1; j = N;
	
	while ( mn != -1 && mx != -1 ) {
		MinMax(mn+1, mx-1, &mn, &mx);
		i ++; j --;
		if ( mn == -1 ) break;
		a[i] = mn; a[j] = mx;
	}

  long long diff = 0;
  for ( i = 1; i < N; i ++ ) {
    diff = max(diff, a[i+1] - a[i]);
	}

	return diff;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:13: error: 'LLONG_MAX' was not declared in this scope
   11 |  MinMax(0LL,LLONG_MAX, &mn, &mx);
      |             ^~~~~~~~~
gap.cpp:3:1: note: 'LLONG_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include<iostream>
  +++ |+#include <climits>
    3 | using namespace std;