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>
#include "ricehub.h"
using namespace std;
#define ll long long
int besthub(int R, int L, int X[], ll B) {
ll ans = 1, cntL = 1, sum = 0, l = 0;
for (int i = 1; i < R; i++) {
sum += cntL * (X[i] - X[i - 1]);
while (sum > B) {
sum -= X[i] - X[l];
l++;
cntL--;
}
cntL++;
ans = max(ans, cntL);
}
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... |