# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1027777 | vjudge1 | Rice Hub (IOI11_ricehub) | C++17 | 1050 ms | 1372 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 <bits/stdc++.h>
using namespace std;
int besthub(int n, int l, int x[], long long b)
{
long long max_rez=-1, sol=1;
for(int i=0; i<n; i++)
{
multiset<int>s;
for(int j=0; j<n; j++)
{
s.insert(abs(x[j]-x[i]));
}
long long sum=0, rez=0;
for(auto it=s.begin(); it!=s.end(); it++)
{
sum+=(*it);
if(sum>b)
{
break;
}
rez++;
}
if(max_rez<rez)
{
max_rez=rez;
sol=x[i];
}
}
return max_rez;
}
/*int main()
{
int r, l;
long long b;
cin>>r>>l;
int x[r];
for(int i=0; i<r; i++)
cin>>x[i];
cin>>b;
cout<<besthub(r, l, x, b);
return 0;
}*/
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... |