# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
224633 | Amy313 | 쌀 창고 (IOI11_ricehub) | C++14 | 0 ms | 0 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>
int besthub(int R, int L, int X[], long long B)
{
int r, maxi= -1, cp = B, c, a;
for(int i=0; i<L; i++)
{
c = 0;
r = i;
cp = B;
for(int j=0; j<R; j++)
{
a = abs(i-X[j]);
if(a<=cp)
{
cp-=a;
c++:
}
else
{
break;
}
}
if(c>maxi)
{
maxi = c;
}
}
return maxi;
}