Submission #1092489

#TimeUsernameProblemLanguageResultExecution timeMemory
1092489alexander707070Gap (APIO16_gap)C++14
0 / 100
38 ms7256 KiB
#include<bits/stdc++.h> #include "gap.h" #define MAXN 600007 using namespace std; const long long inf=1e18; long long *l,*r,*ll,*rr; long long d,ans; long long findGap(int T, int N){ l=new long long(); r=new long long(); MinMax(1, inf, l,r); if(N==2)return *r-*l; if(N<=100)return 1/0; d=ans=1; while(*l!=*r){ while(true){ ll=new long long(); rr=new long long(); MinMax((*l)+1,(*l)+d+1,ll,rr); if((*ll)!=-1)break; d*=2; } ans=max(ans,*ll-*l); d=ans; l=rr; } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:21:20: warning: division by zero [-Wdiv-by-zero]
   21 |  if(N<=100)return 1/0;
      |                   ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...