# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
224672 | Amy313 | Rice Hub (IOI11_ricehub) | C++14 | 1094 ms | 640 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)
{vector<int>V;
int maxi= 0, c, a;
long long cp = B;
for(int i=1; i<=L; i++)
{
c = 0;
cp = B;
V.clear();
for(int j=0; j<R; j++)
{
a = abs(i-X[j]);
V.push_back(a);
}
sort(V.begin(), V.end());
for(int j=0; j<V.size(); j++)
{
if(V[j]<=cp)
{
cp-=V[j];
c++;
}
else
{
break;
}
}
if(c>maxi)
{
maxi = c;
}
}
return maxi;
}
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... |