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;
int besthub(int R, int L, int X[], long long B)
{
long long int bst = 0, cc = 0, nh = 1, mi = 0, li = 0, ri = 0;
while(ri < R)
{
if(cc > B)
{
cc -= X[mi] - X[li];
++li;
if(nh & 1) ++mi;
--nh;
}
else
{
bst = max(bst, nh);
++ri;
cc += X[ri] - X[mi];
if(nh & 1) ++mi;
++nh;
}
}
return bst;
}
# | 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... |