제출 #467652

#제출 시각아이디문제언어결과실행 시간메모리
467652SirCovidThe19thGap (APIO16_gap)C++17
0 / 100
70 ms1100 KiB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std; 

#define ll long long

ll findGap(int t, int n){
    ll mn, mx, lim, lb, ans = 0; 
    MinMax(1, 1e18, &mn, &mx); 
    lb = (mx - mn) / (n - 1); lim = mx;
    for (ll l = mn, r = mn + lb - 1, prvMx = 1e18; l < lim; l += lb, r += lb){
        MinMax(l, r, &mn, &mx);
        ans = max(ans, mn - prvMx);
        if (~mx) prvMx = mx; 
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...