Submission #16727

#TimeUsernameProblemLanguageResultExecution timeMemory
16727CodingBugRice Hub (IOI11_ricehub)C++98
100 / 100
24 ms4988 KiB
#include "ricehub.h" int besthub(int R, int L, int X[], long long B) { int s,e,m,mx; long long su; for(s=0,e=0,su=0,mx=0;e<R;){ if(su<=B){ if(mx<e-s+1) mx=e-s+1; e++; m=(s+e)/2; su+=X[e]-X[m]; }else{ s++; m=(s+e)/2; su-=X[m]-X[s-1]; } } return mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...