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>
#include "gap.h"
using namespace std;
long long n;
vector<long long> v;
long long findGap(int t,int N)
{
n=N;
long long l=0,r=0;
MinMax(0,1e18,&l,&r);
long long x=(l-n)/(n-1);
long long last=-1;
long long ans=0;
for(int i=l;i<=r;i+=x)
{
long long j=min(i+x,r);
long long mn,mx;
MinMax(i,j,&mn,&mx);
if(last!=-1)ans=max(mn-last,ans);
last=mx;
}
return ans;
}
/*int main()
{
long long d=0;
int x;
cin>>x>>nn;
for(int i=1;i<=nn;i++)
{
cin>>a[i];
if(i!=1)d=max(d,a[i]-a[i-1]);
}
long long answer=findGap(1,nn);
cout<<d<<" "<<answer<<endl;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |