# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88010 | Pajaraja | Rice Hub (IOI11_ricehub) | C++17 | 22 ms | 15972 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 n,l;
long long b,x[100007];
bool provera(int k)
{
int poc=0,krj=k,med=k/2;
long long spr=0,spo=0;
for(int i=0;i<med;i++) spr+=x[i];
for(int i=med+1;i<krj;i++) spo+=x[i];
while(krj<=n)
{
long long sum=spo-spr+(k%2==0?x[med]:0);
if(sum<=b) return true;
spr-=x[poc];
spo+=x[krj];
spr+=x[med];
poc++;
krj++;
med++;
spo-=x[med];
}
return false;
}
int binarna(int l,int r)
{
if(l==r) return l;
int s=(l+r+1)/2;
if(provera(s)) return binarna(s,r);
# | 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... |