Submission #1227552

#TimeUsernameProblemLanguageResultExecution timeMemory
1227552lance0Gap (APIO16_gap)C++20
0 / 100
31 ms2668 KiB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
ll st1(ll N) {
	vector<ll> small, large;
	ll x = 0, y = 1e18;
	while (x+1 <= y-1) {
		MinMax(x+1, y-1, &x, &y);
		if (x != -1) {
		  small.push_back(x);
		}
		if (y != -1) {
		  large.push_back(y);
		}
	}
	for (int i = large.size()-1; i >= 0; i--) {
		small.push_back(large[i]);
	}
	ll ans = 0;
	for (int i = 0; i < small.size()-1; i++) {
		ans = max(ans, small[i+1]-small[i]);
	}
	return ans;
}
ll st2(ll N) {
	return 0;	
}
ll findGap(int T, int N) {
	if (T == 1) {
		return st1(N);
	} else {
		return st2(N);
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...