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<bits/stdc++.h>
using namespace std;
#include "gap.h"
long long t,n,st,ed,mn,mx,ans=-1;
long long findGap(int T, int N)
{
t=T;
n=N;
if(t==1)
{
st=0;
ed=1e18;
for(int i=1;i<=(n+1)/2;i++)
{
MinMax(st,ed,&mn,&mx);
//printf("%d %lld %lld %lld %lld\n",i,st,mn,mx,ed);
if(i>1)
{
ans=max(ans,mn-st-1);
ans=max(ans,ed-mx+1);
}
st=mn+1;
ed=mx-1;
}
ans=max(ans,ed-st+2);
return ans;
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
28 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |