제출 #960069

#제출 시각아이디문제언어결과실행 시간메모리
960069MinaRagy06Gap (APIO16_gap)C++17
0 / 100
43 ms3108 KiB
#include <bits/stdc++.h>
#include "gap.h"
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
#define ll long long

const ll inf = 1e18;
ll findGap(int t, int n) {
	ll s, e;
	MinMax(0, inf, &s, &e);
	if (n == 2) {
		return e - s;
	}
	ll len = e - s;
	ll b = (len - 1) / (n - 1);
	ll lst = s, mx = 0;
	ll en = e;
	for (ll i = s + 1; i <= en - 1; i += b) {
		MinMax(i, min(i + b - 1, en - 1), &s, &e);
		if (s == -1) continue;
		if (s != -1) {
			mx = max(mx, s - lst);
		}
		lst = e;
	}
	return mx;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...