제출 #671092

#제출 시각아이디문제언어결과실행 시간메모리
671092AdamGSGap (APIO16_gap)C++17
0 / 100
52 ms1188 KiB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e18;
ll findGap(int t, int n) {
        ll mi, ma;
        MinMax(0, INF, &mi, &ma);
        ll x=(ma-mi+n-2)/(n-1), ans=x;
        ll lst=mi;
        for(ll i=mi; i<=ma; i+=x+1) {
                ll a, b;
                MinMax(i, i+x, &a, &b);
                if(a==-1) continue;
                ans=max(ans, a-lst);
                lst=b;
        }
        return x;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...