# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
614807 | Shithila | Rice Hub (IOI11_ricehub) | C++14 | 1066 ms | 504 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)
{
int dis[R];
int pos=0;
int max=0;
for(int i=0;i<L;i++)
{
for(int j=0;j<R;j++)
{
dis[j]=abs(i-X[j]);
}
sort(dis,dis+R);
int sum=0;
int j=0;
while(sum<=B && i<R)
{
sum=sum+dis[j];
j++;
}
sum=sum-dis[j];
if(max<sum)
{
max=sum;
pos=i;
}
}
return max;
}
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... |