This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll lim=1e18;
ll findGap(int T, int N)
{
ll a,b,c=-1,d=-1;
ll l=0,r=lim,ans=0;
while(l<r)
{
MinMax(l,r,&a,&b);
if(c!=-1 && a!=-1) ans=max(ans,a-c);
if(d!=-1 && b!=-1) ans=max(ans,d-b);
if(a==-1 && b==-1) ans=max(ans,d-c);
l=a+1;r=b-1;
c=a;d=b;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |