제출 #483904

#제출 시각아이디문제언어결과실행 시간메모리
483904beaconmcGap (APIO16_gap)C++14
0 / 100
46 ms2268 KiB
#include <bits/stdc++.h>
#include "gap.h"
typedef long long ll;
#define FOR(i, x, y) for(ll i=x; i<y; i++)

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
  
#define ordered_set tree<ll, null_type,greater_equal<int>, rb_tree_tag,tree_order_statistics_node_update>

ll findGap(int t, int n){
    if (t==1){
        vector<ll> sussy;
        sussy.clear();
        ll l=0; ll r=1000000000000000000;
        ll lc=0; ll rc=0;
        while (l<r){
            MinMax(l,r,&lc,&rc);
            if (lc==-1){
                break;
            }
            sussy.push_back(lc);
            sussy.push_back(rc);
            l = lc+1; r=rc-1;
        }
        sort(sussy.begin(), sussy.end());
        ll prv = sussy[0];
        ll maxi = -1;
        for (auto&i : sussy){
            maxi = max(maxi, i-prv);
            prv = i;
        }
        return maxi;
        
    }
    return 0;
    
}

/*
int main(){
}*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...