제출 #117905

#제출 시각아이디문제언어결과실행 시간메모리
117905Mahdi_JfriGap (APIO16_gap)C++14
0 / 100
61 ms5788 KiB
#include "gap.h"
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back

const int maxn = 1e5 + 20;

ll a[maxn];

long long findGap(int T, int n)
{
	if(T == 1)
	{
		ll l = 0 , r = 1e18;
		for(int i = 0; i < (n + 1) / 2; i++)
		{
			ll x , y;
			MinMax(l , r , &x , &y);
			a[i] = x;
			a[n - i - 1] = y;
			l = x + 1 , r = y - 1;
		}

		for(int i = 0; i < n; i++)
			cout << a[i] << " K ";
		cout << endl;

		ll res = 0;
		for(int i = 1; i < n; i++)
			res = max(res , a[i] - a[i - 1]);

		return res;
	}
	return 0;
}





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