제출 #106942

#제출 시각아이디문제언어결과실행 시간메모리
106942maksim_gaponovGap (APIO16_gap)C++14
0 / 100
64 ms1192 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll

const int MAX = 1e18;

int findGap(signed T, signed N) {
	int l = 0;
	int r = MAX;
	MinMax(l, r, &l, &r);
	int ans = 0;
	while (r != l) {
		int nl;
		int nr;
		MinMax(l + 1, r - 1, &nl, &nr);
		if (nl != -1) {
			ans = max(ans, r - nr);
			ans = max(ans, nl - l);
		}
		r = nr;
		l = nl;
		// cout << r << ' ';
	}
	// cout << endl;
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...