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"
#include <bits/stdc++.h>
using namespace std;
int besthub(int R, int L, int X[], long long B){
int res = 0;
long long baht = 0;
for(int i=0,j=0;i<R;i++){
while(j+1 < R && baht + X[j+1]-X[(i+j+1)/2] <= B){
baht += X[j+1]-X[(i+j+1)/2];
j++;
res = max(res,j-i+1);
}
baht -= X[(i+j+1)/2]-X[i];
}
return res;
}
# | 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... |