#include <bits/stdc++.h>
#include "ricehub.h"
using namespace std;
#define endl "\n"
#define pb push_back
#define ll long long
#define fi first
#define se second
const int N = 3e5 + 5, M = 1e9 + 7, LG = 20;
int R , A[N] , L , B;
int besthub(int n, int sz, int X[], long long b){
int l=0 , r=n+1;
while(l+1 < r){
ll mid = (l+r)>>1 , cr = 1e18;
for (int i=0 ; i<n-mid+1 ; i++){
int l1 = X[i] , r1 = X[i+mid-1];
cr = min(cr , (r1-l1) * (mid/2));
}
if (cr <= b){
l = mid;
}else{
r = mid;
}
}
return l;
}
// signed main(){
// cin >> R >> L >> B;
// for (int i=0 ; i<R ; i++){
// cin >> A[i];
// }
// cout << besthub(R , L , A , B);
// }
| # | 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... |