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>
long long findGap(int T, int N)
{
long long arr[111111];
long long mn, mx;
long long high=1e18,low=1;
if(T==1)
{
for(int i=1;i<=N/2;i++)
{
MinMax(low,high,&mn,&mx);
arr[i]=mn;
arr[N-i+1]=mx;
low=mn+1;
high=mx-1;
}
if(N%2==1)
{
MinMax(low,high,&mn,&mx);
arr[N/2+1]=mn;
}
long long answer=0;
for(int i=2;i<=N;i++)
answer=std::max(answer,arr[i]-arr[i-1]);
return answer;
}
else
{
return 0;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |