# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1149692 | vladilius | Gap (APIO16_gap) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
const ll inf = 1e18;
ll findGap(int T, int n){
ll l, r, s = 0, t = inf;
vector<ll> a(n);
for (int i = 0; i < (n + 1) / 2; i++){
MinMax(s, t, l, r);
a[i] = l; a[n - i - 1] = r;
s = l + 1; t = r - 1;
}
ll out = 0;
for (int i = 0; i < (n - 1); i++){
out = max(out, a[i + 1] - a[i]);
}
return out;
}