# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133001 | Boxworld | Rice Hub (IOI11_ricehub) | C++14 | 499 ms | 54828 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;
const int maxN=100100;
long long S[maxN];
int besthub(int R, int L, int X[], long long B){
for (int i=0;i<R;i++)S[i]=S[i-1]+X[i];
int l,r,ans=1;
for (int l=0;l<R;l++)
for (int r=l;r<R;r++){
int m=(l+r)/2,nL=l-1;
long long cost=S[m]-S[l-1]-(m-l+1)*X[l]+S[r]-S[m]-(r-m)*X[m];
printf("l=%d r=%d m=%d cost=%lld\n",l,r,m,cost);
if(cost<=B)ans=max(ans,r-l+1);
else break;
}
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... |