제출 #671093

#제출 시각아이디문제언어결과실행 시간메모리
671093AdamGSGap (APIO16_gap)C++17
70 / 100
58 ms1088 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 ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...