# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
986314 | Pyqe | Rice Hub (IOI11_ricehub) | C++17 | 11 ms | 3676 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;
long long ps[100069],inf=1e18;
int besthub(int n,int ln,int a[],long long d)
{
long long i,lh,rh,md,zz,mn;
for(i=1;i<=n;i++)
{
ps[i]=ps[i-1]+a[i-1];
}
for(lh=1,rh=n;lh<=rh;)
{
md=(lh+rh)/2;
mn=inf;
for(i=md;i<=n;i++)
{
mn=min(mn,ps[i]-ps[i-md/2]-ps[i-md+md/2]+ps[i-md]);
}
if(mn<=d)
{
zz=md;
lh=md+1;
}
else
{
rh=md-1;
}
}
return zz;
}
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... |