제출 #1297300

#제출 시각아이디문제언어결과실행 시간메모리
1297300denislavGap (APIO16_gap)C++20
0 / 100
11 ms3236 KiB
# include <iostream> # include <vector> # include <algorithm> using namespace std; # include "gap.h" //# include "grader.cpp" const long long INF=1e18; int n; long long findGap(int T, int _N) { n=_N; long long last=0,ans=0; for(int bit=1;bit<60;bit++) { long long mn,mx; MinMax(last+1,last+(1LL<<bit),&mn,&mx); if(mn!=-1) { last=mn; break; } } while(true) { bool B=0; for(int bit=1;bit<=60;bit++) { long long mn,mx; long long s=last+1,t=min(INF,last+(1LL<<bit)); MinMax(s,t,&mn,&mx); if(mn==-1) { if(t==INF) { B=1; break; } else continue; } else { ans=max(ans,mn-last); last=mx; } } if(B) break; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...