| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1323938 | aritro_ | Gap (APIO16_gap) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
#define int ll
#define pb push_back
//void MinMax(ll s,ll t,ll &mn,ll &mn);
ll findGap(int t,int n){
ll l=-1,r=1e18 + 1;
vector<int> ans;
for(int i=0;i<=(n+1)/2;i++){
MinMax(l+1,r-1,&l,&r);
ans.pb(l);
if(l!=r) ans.pb(r);
}
sort(ans.begin(),ans.end());
int res=0;
for(int i=0;i<n-1;i++) res=max(res,a[i+1]-a[i]);
return res;
}