제출 #1075780

#제출 시각아이디문제언어결과실행 시간메모리
1075780alexddGap (APIO16_gap)C++17
0 / 100
35 ms1216 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; #define int long long const int INF = 1e18; pair<int,int> qry(int le, int ri) { pair<int,int> aux; MinMax(le,ri,&aux.first,&aux.second); return aux; } long long findGap(int32_t T, int32_t N) { if(N<=100) return 1; int rez=1; pair<int,int> tot = qry(0,INF); int cur=tot.first; while(cur+rez+1 < tot.second) { pair<int,int> aux = qry(cur+1,cur+rez); if(aux.first!=-1) { cur = aux.second; continue; } int c=rez; while(1) { c=c*2; aux = qry(cur+1,cur+c); if(aux.first!=-1) { rez = max(rez, aux.first - cur); cur = aux.second; break; } } } return rez; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...