#include <bits/stdc++.h>
// mrrrow meeow :3
// go play vivid/stasis now! it's free on steam
#define fo(i, a, b) for (auto i = (a); i < (b); i++)
#define of(i, a, b) for (auto i = (b); i-- > (a);)
#define f first
#define s second
#define pb push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define be(a) a.begin(), a.end()
using namespace std;
int ____init = [] {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
return 0;
}();
long long px[100001];
int besthub(int rl, int _, int x[], long long b) {
fo(i, 0, rl) px[i + 1] = px[i] + x[i];
int res = 0;
fo(i, 0, rl) {
int l = i, r = rl;
while (l < r) {
int mid = (l + r + 1) / 2;
if ((px[mid] - px[(i + mid + 1) / 2]) - (px[(i + mid) / 2] - px[i]) <= b) l = mid;
else r = mid - 1;
}
res = max(res, l - 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... |