Submission #464648

#TimeUsernameProblemLanguageResultExecution timeMemory
464648nickmet2004Gap (APIO16_gap)C++11
0 / 100
55 ms1172 KiB
#include<bits/stdc++.h>
#include "gap.h"
#define ll long long
using namespace std;
ll findGap(int T , int n){
    ll ANS = 0;
    if(T==1){
        ll x =0, y = 1e18;
        for(int i = 1; i<= (n + 1) /2; ++i){
            ll mn , mx;
            MinMax(x , 1e18 , &mn , &mx);
            ANS = max(ANS , mn - x+1);
            MinMax(0 , y , &mn , &mx);
            ANS = max(ANS , y - mx+1);
            x = mn + 1;
            y = mx - 1;
        }
    }
    return ANS;

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...