# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
355600 | David_M | Rice Hub (IOI11_ricehub) | C++14 | 18 ms | 1644 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 "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
int besthub(int R,int L,int X[],long long B){
long long ans=0, pref[100005], l=0, r=0, m, b;
for (int i=0; i<R; i++)pref[i]=X[i]+(!!i)*pref[i-1];
for (;r<R;r++){
while(l<r){
m=l+r>>1;
b=pref[r]+(!!l)*pref[l-1]-(pref[m]<<1);
if((l+r+1)&1)b+=X[m];
if(b<=B)break;
l++;
}
if(r-l>ans)ans=r-l;
}
return ans+1;
}
Compilation message (stderr)
# | 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... |