제출 #1292132

#제출 시각아이디문제언어결과실행 시간메모리
1292132goulthenGap (APIO16_gap)C++20
30 / 100
28 ms3232 KiB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;

#define ll long long
#define rep(i,a,b) for(int i = a; i <= b; i++)
const int MAXN = 1e5+10;
ll a[MAXN];

ll sub1(int n) {
	ll s=0,t=1e18,l=1,r=n;
	while (l<=r) {
		MinMax(s,t,&s,&t);
		a[l++] = s;
		a[r--] = t;
		s++;t--;
	}

	ll ans = 0;
	rep(i,1,n-1) ans = max(ans, a[i+1]-a[i]);
	return ans;
}

ll findGap(int T, int N)
{
	if(T==1) return sub1(N);
	else return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...