제출 #632795

#제출 시각아이디문제언어결과실행 시간메모리
632795dozerGap (APIO16_gap)C++14
53.51 / 100
54 ms1104 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

long long findGap(int T, int N)
{
	long long l, r;
	MinMax(1, 1e18, &l, &r);
	long long lim = (r - l) / N;
	long long ans = lim, curr = l;
	while(l != r)
	{
		long long a, b;
		MinMax(curr + 1, curr + lim, &a, &b);
		if (a == -1) curr += lim;
		else
		{
			ans = max(ans, a - l);
			l = b;
			curr += lim;
		}
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...