Submission #152774

#TimeUsernameProblemLanguageResultExecution timeMemory
152774arnold518Gap (APIO16_gap)C++14
30 / 100
57 ms2396 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 1e5;

int T, N;
ll A[MAXN+10], ans;

ll findGap(int _T, int _N)
{
    int i, j;
    T=_T; N=_N;

    ll s=0, t=1e18;
    for(i=1, j=N; i<=j; i++, j--)
    {
        ll a, b;
        MinMax(s, t, &a, &b);
        A[i]=a; A[j]=b;
        s=a+1; t=b-1;
    }
    for(i=2; i<=N; i++) ans=max(ans, A[i]-A[i-1]);
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...