제출 #111544

#제출 시각아이디문제언어결과실행 시간메모리
111544aleksamGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h"
#define LLMAX 1000000000000000000LL
long long findGap(int T, int N)
{
	assert(N<250);
	long long apsmin, apsmax;
	MinMax(0, LLMAX, &apsmin, &apsmax);
	long long g=1, gg=1;
	long long last=apsmin;
	while(1){
		long long mn, mx;
		MinMax(last+1, last+g, &mn, &mx);
		if(mn==-1){
			g*=2;
			continue;
		}
		if(mn-last>gg){
			gg=mn-last;
			g=gg;
			
		}
		last=mx;
		if(mx==apsmax)break;
	}
	return gg;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:5:2: error: 'assert' was not declared in this scope
  assert(N<250);
  ^~~~~~
gap.cpp:5:2: note: suggested alternative: 'short'
  assert(N<250);
  ^~~~~~
  short