# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
289604 | Doxeno | Rice Hub (IOI11_ricehub) | C++17 | 0 ms | 0 KiB |
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;
long long besthub(long long N, long long L, long long risaie[], long long B){
long long left=0,right=0;
long long spesa = 0;
long long m =1;
while(right<N-1){
if(spesa>B){
spesa+=risaie[left]-risaie[(++left+right)/2];
}else{
right++;
spesa+=risaie[right]-risaie[(left+right)/2];
// if(spesa<=B)m=max(,max
}
if(spesa<=B)m=max(m,right-left+1);
}
return m;
}