Submission #1192523

#TimeUsernameProblemLanguageResultExecution timeMemory
1192523GrayGap (APIO16_gap)C++20
48.54 / 100
74 ms1192 KiB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define ff first
#define ss second
#define ln "\n"
#define mp make_pair
#define pb push_back
#define INF (ll)1e18
ll MOD = 1e9+7;


long long findGap(int T, int N)
{
    ll l, r; MinMax(0, 1e18, &l, &r);
    // cout << l << " " << r << endl;
    ll md = (r-l-1)/(N-1);
    ll res=0;
    for (ll i=l+1; i<r;){
        ll to = i-1;
        ll mn=-1, mx=-1;
        while (mn==-1){
            to+=md;
            MinMax(i, to, &mn, &mx);
        }
        res=max(res, mn-i);
        i=mx+1;
        // cout << i << endl;
    }
	return res+1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...