Submission #540515

#TimeUsernameProblemLanguageResultExecution timeMemory
540515dutinmeowGap (APIO16_gap)C++17
0 / 100
56 ms2256 KiB
#include <bits/stdc++.h>
using namespace std;

#include "gap.h"

const long long MAX_A = 1e18;

void findGap(int T, int N) {
	if (T == 1) {
		long long l = 1, r = MAX_A;
		vector<long long> A;
		for (int i = 0; i < (N + 1) / 2; i++) {
			long long nl, nr;
			MinMax(l, r, &nl, &nr);
			A.push_back(l);
			A.push_back(r);
			l = ++nl, r = --nr;
		}
		sort(A.begin(), A.end());
		long long ans = 0;
		for (int i = 1; i < N; i++)	
			ans = max(ans, A[i] - A[i - 1]);
		cout << ans << '\n';
	} else {

	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...