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;
long long int typedef li;
int besthub(int n, int m, int x[], li b)
{
int kolko=0;
for (int i=0;i<n;i++)
{
vector<int> pom;
for (int j=0;j<n;j++) pom.push_back(abs(x[i]-x[j]));
sort(pom.begin(),pom.end());
li tmp=b; int sta=0;
for (int j=0;j<n;j++)
{
if (pom[j]>tmp) break;
sta++; tmp-=pom[j];
}
kolko=max(kolko,sta);
}
return kolko;
}
# | 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... |