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>
#define pii pair<int,int>
#define ll long long
using namespace std;
const ll inf=1e18;
long long findGap(int T, int N)
{
ll mx,mn;
mx=mn=-1;
MinMax(0,inf,&mn,&mx);
ll sm=mn;
ll up=mx;
ll off=(mx-mn-1)/N;
ll lst=sm;
ll cur=0;
ll pnt=sm+1;
for(int i=1;i<N;i++)
{
MinMax(pnt,pnt+off-1,&mn,&mx);
if(mn!=-1)
{
cur=max(cur,mn-lst);
lst=mx;
}
pnt+=off;
}
MinMax(pnt,up-1,&mn,&mx);
if(mn!=-1)
{
cur=max(cur,mn-lst);
cur=max(cur,up-mx);
}
else
{
cur=max(cur,up-lst);
}
return cur;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |