Submission #1287491

#TimeUsernameProblemLanguageResultExecution timeMemory
1287491khoavn2008Gap (APIO16_gap)C++17
0 / 100
12 ms1164 KiB
#ifndef KHOA
#include "gap.h"
#endif // KHOA

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define FOR(i,l,r) for(int i = (l), _r = (r); i <= _r; i++)
#define FORNG(i,r,l) for(int i = (r), _l = (l); i >= _l; i--)
#define REP(i,r) for(int i = 0, _r = (r); i < _r; i++)
#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define size(v) ((ll)(v).size())
#define MASK(x) (1LL << (x))
#define BIT(x, i) (((x) >> (i)) & 1)

const ll MOD = 1e9 + 7, N = 2e5 + 10, INF = 1e18, LOG = 21;
ll a[N];

#ifdef KHOA
void MinMax(ll x,ll y,ll z,ll t){}
#endif

ll findGap(int T, int n){
    ll l = 0, r = 1e18;
    for(int head = 1, tail = n; head <= tail; head++, tail--){
        ll *L,*R;
        MinMax(l, r, L, R);
        l = *L;
        r = *R;
        a[head] = l;
        a[tail] = r;
        l++,r--;
    }
    ll ans = INF;
    FOR(i,1,n - 1)ans = min(ans, a[i + 1] - a[i]);
    return ans;
}

#ifdef KHOA
int main(){
    //freopen(".inp", "r", stdin);
    //freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(0);cin.tie(0);

}
#endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...