제출 #112241

#제출 시각아이디문제언어결과실행 시간메모리
112241user202729Gap (APIO16_gap)C++17
30 / 100
48 ms2176 KiB
#include "gap.h"
#include<vector>

using ll=long long;
ll findGap(int t, int n)
{
	if(t==1){
		std::vector<ll> a(n);
		auto first=begin(a),last=--end(a);
		ll min=0,max=1000000000000000000LL;
		while(first<=last){
			ll a,b;
			MinMax(min,max,&a,&b);
			min=a+1;max=b-1;
			*first++=a;
			*last--=b;
		}
		ll ans=0;
		for(int i=1;i<n;++i)
			ans=std::max(ans,a[i]-a[i-1]);
		return ans;
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...