#include "gap.h"
#include<bits/stdc++.h>
#define int long long
using namespace std;
long long findGap(int32_t T, int32_t n)
{
vector<int> a;
int x = -1, y = 2e18;
for(int i = 1; i <= (n+1)/2; i++){
MinMax(x+1, y-1, &x, &y);
a.push_back(x);
if(x != y) a.push_back(y);
}
sort(a.begin(), a.end());
int ans = 0;
for(int i = 1; i < a.size(); i++) ans = max(ans, a[i] - a[i-1]);
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |