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 ll;
ll MX = 1e18;
ll A[500500];
ll findGap1(int N){
    int L=1, R=N;
    ll mn = 0, mx = MX;
    while( L <= R ){
        ll a,b;
        MinMax(mn, mx, &a, &b);
        A[L++] = a; A[R--] = b;
        mn = a + 1; mx = b-1;
    }
    ll ans = 0;
    for(int i=1;i<N;i++) ans = max(ans, A[i+1]-A[i]);
    return ans;
}
ll findGap2(int N){
    return -1;
}
long long findGap(int T, int N){
    if( T == 1 ) return findGap1(N);
    else return findGap1(N);
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |