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>
using namespace std;
typedef long long int lli;
const int MAXN = 100010;
lli v[MAXN];
long long findGap(int T, int N)
{
lli L = 0LL;
lli R = 1000000000000000000LL;
for(int i = 1 ; i <= N - i + 1 ; i++)
{
lli aux1, aux2;
lli *mx = &aux1;
lli *mn = &aux2;
MinMax( L , R , mn , mx );
v[i] = aux2;
v[N - i + 1] = aux1;
L = aux2 + 1;
R = aux1 - 1;
}
lli ans = 0;
for(int i = 1 ; i < N ; i++)
ans = max( ans , v[i + 1] - v[i] );
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |