제출 #95616

#제출 시각아이디문제언어결과실행 시간메모리
95616dwscGap (APIO16_gap)C++14
30 / 100
68 ms3184 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
long long findGap(int T, int N)
{
    long long arr[N];
    long long x1,x2;
    long long low = 0,high = 1e18;
    for (int i = 0; i < (N+1)/2; i++){
        MinMax(low,high,&x1,&x2);
        arr[i] = x1,arr[N-i-1] = x2;
        low = x1+1,high = x2-1;
    }
    long long ans = 0;
    for (int i = 0; i < N-1; i++) ans = max(ans,arr[i+1]-arr[i]);
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...