# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23280 | repeating | Gap (APIO16_gap) | C++11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#define ll long long
const long long INF = 2e9;
long long MOD = 1e9+7;
void MinMax(ll ,ll ,long long &,long long &);
void MinMax(ll s,ll t,long long &mn,long long &mx){
// cout<<s<<" "<<t<<endl;
// cin>>mn>>mx;
}
long long findGap(int,int);
long long findGap(int t,int n){
ll l=0,r=1e18;
vector<ll> v;
ll res=0;
ll l1=1e18,r1=0;
while(l<r){
MinMax(l+1,r-1,l,r);
if(l!=-1)v.push_back(l);
if(r!=-1)v.push_back(r);
if(r!=-1)res=max(res,max(r1-r,l-l1));
if(l==-1)res=max(res,r1-l1);
r1=r,l1=l;
if(l==-1)break;
}
return res;
}
//int main(){
// cout<<findGap(1,4);
//}