제출 #111550

#제출 시각아이디문제언어결과실행 시간메모리
111550aleksamGap (APIO16_gap)C++14
0 / 100
64 ms1272 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define LLMAX 1000000000000000000LL
long long findGap(int T, int N)
{
	assert(N>10);
	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;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...