제출 #1350702

#제출 시각아이디문제언어결과실행 시간메모리
1350702the_commando_xGap (APIO16_gap)C++17
30 / 100
18 ms1212 KiB
#include "gap.h"

#include <bits/stdc++.h>

long long findGap(int T, int N)
{

	long long MN, MX;
	MinMax(0, 1e18 + 1, &MN, &MX);

	long long best = 0;
	if (T == 1)
	{
		for (int i = 1; i < (N + 1) / 2; ++i)
		{
			long long a, b;
			MinMax(MN + 1, MX - 1, &a, &b);
			best = std::max({best, a - MN, MX - b});
			MN = a, MX = b;
		}
		best = std::max(best, MX - MN);
	}

	return best;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...