# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
917817 | Nonoze | Rice Hub (IOI11_ricehub) | C++17 | 13 ms | 3832 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)
{
#define int long long
int n=R, l=L, b=B;
int ans=1;
int sum=0;
int beg=0;
for (int i=0; i<n; i++) {
sum+=X[i];
sum-=X[beg+(i-beg)/2];
while (sum>B) {
sum+=X[beg];
sum-=X[beg+(i-beg)/2+(i-beg)%2];
beg++;
}
ans=max(ans, i-beg+1);
}
return ans;
}
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... |