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 ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll ma,L,R,gm,i,LT,RT;
vector<ll> v;
long long findGap(int T, int N)
{
ma=0;
MinMax(0,(ll)1e18,&L,&R);
gm=(R-L)/(N-1);
for(i=L;i<R;i+=(gm+1))
{
//cout<<i<<" "<<min(i+gm,R)<<"\n";
MinMax(i,min(i+gm,R),<,&RT);
if(LT!=-1)
v.pb(LT);
if(LT!=RT)
v.pb(RT);
}
for(i=1;i<v.size();i++)
ma=max(ma,v[i]-v[i-1]);
return ma;
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:25:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=1;i<v.size();i++)
~^~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |