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<vector>
using ll=long long;
ll findGap(int t, int n)
{
if(t==1){
std::vector<ll> a(n);
auto first=begin(a),last=--end(a);
ll min=0,max=1000000000000000000LL;
while(first<=last){
ll a,b;
MinMax(min,max,&a,&b);
min=a+1;max=b-1;
*first++=a;
*last--=b;
}
ll ans=0;
for(int i=1;i<n;++i)
ans=std::max(ans,a[i]-a[i-1]);
return ans;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |