#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll = long long;
const int MAXN = 1e5 + 10;
ll a[MAXN];
ll findGap(int t, int n){
int l = 1, r = n;
ll cur_s = 0, cur_t = 1e18;
ll mn = 0, mx = 1e18;
while(l < r){
MinMax(cur_s, cur_t, &mn, &mx);
a[l] = mn;
a[r] = mx;
cur_s = a[l] + 1;
cur_t = a[r] - 1;
l ++;
r --;
}
ll ans = 0;
for(int i=1; i<n; i++) ans = max(ans, a[i + 1] - a[i]);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |