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