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
long long findGap(signed t,signed n)
{
ll mn1,mx1,lim1=0,lim2=1e18,mn,mx;
MinMax(lim1,lim2,&mn1,&mx1);
ll s=0,e=1e18;
while (s+1<e)
{
ll mid = (s+e)/2, l = mn1;
bool b=0;
while (l+mid<mx1)
{
MinMax(l+1,l+mid,&mn,&mx);
if (mn==-1)
{
b=1;
break;
}
l=mx;
}
if (b)
s=mid;
else
e=mid;
}
return s+1;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |