#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll = long long;
ll findGap(int t, int n){
vector <ll> v;
ll curmn=0,curmx=1e18+1,mn,mx;
while (curmn<=curmx){
MinMax(curmn,curmx,&mn,&mx);
if (mn!=-1){v.push_back(mn);curmn=mn+1;}
if (mx!=-1 && mn!=mx){v.push_back(mx);curmx=mx-1;}
if (mx==-1){break;}
}
sort(v.begin(),v.end());
ll ans=-1;
for (int i=1; i<v.size(); i++){
ans=max(ans,v[i]-v[i-1]);
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |