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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MN=1e5+2;
int besthub(int R,int L,int X[],ll B) {
int ans=1;
ll cost=0;
for(int l=0,r=0;r<R;++r) {
cost+=X[r]-X[(l+r-1)/2];
while(cost>B) {
cost-=X[(l+r)/2+1]-X[l];
++l;
}
ans=max(ans,r-l+1);
}
return ans;
}
# | 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... |