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 <algorithm>
using namespace std;
long long A[1000*100+1];
long long findGap(int T, int N)
{
long long s = 0;
long long t = 1000000000;
t*=t;
long long mn,mx;
MinMax(s,t,&mn,&mx);
long long as = 0;
int sz = (mx-mn-1)/(N-1);
long long nax = -1;
s = mn+1;
t = mn+sz;
while(t<mx){
long long a,b;
MinMax(s,t,&a,&b);
if(a == -1 && b == -1){
if(t == mx-1) break;
s = s+sz;
t = t+sz;
continue;
}
if(nax!=-1){
as = max(as,a-nax);
}
nax = b;
if(t == mx-1) break;
s+=sz;
t+=sz;
t = min(t,mx-1);
}
if(nax){
as = max(as,mx-nax);
}
// cout<<as<<endl;
return as;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |