제출 #1149699

#제출 시각아이디문제언어결과실행 시간메모리
1149699vladiliusGap (APIO16_gap)C++20
30 / 100
29 ms1976 KiB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
const ll inf = 1e18;

ll findGap(int T, int n){
    ll l, r, s = 0, t = inf;
    vector<ll> a(n);
    for (int i = 0; i < (n + 1) / 2; i++){
        MinMax(s, t, &l, &r);
        a[i] = l; a[n - i - 1] = r;
        s = l + 1; t = r - 1;
    }
    ll out = 0;
    for (int i = 0; i < (n - 1); i++){
        out = max(out, a[i + 1] - a[i]);
    }
    return out;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...