This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |