Submission #741994

#TimeUsernameProblemLanguageResultExecution timeMemory
741994vjudge1Gap (APIO16_gap)C++17
30 / 100
42 ms1872 KiB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;

long long findGap(int T, int N){
	long long l = 0, r = 1e18, L = 1, R = N;
	long long a[N+1], mn, mx;
	int cnt = 0;
	while(L <= R){
		cnt++;
		MinMax(l, r, &mn, &mx);
		a[L] = mn, a[R] = mx;
		L++, R--;
		l = mn+1;
		r = mx-1;
	}
	if(cnt > (N+1)/2){
		for(int i=1; i<=1e9; i++) cout << "WA";
	}
	long long ans = 0;
	for(int i=2; i<=N; i++){
		ans = max(ans, a[i] - a[i-1]);
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...