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 mx = 0;
for(int i=1; i<=L; i++) {
int s = 0, c = 0;
vector<int> V;
for(int j=0; j<R; j++) V.push_back(abs(i-X[j]));
sort(V.begin(), V.end());
for(int j=0; j<R; j++) {
if(s + V[j] <= B) {s += V[j]; c++;}
else break;
}
mx = max(mx, c);
}
return mx;
}
# | 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... |