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 au=0;
long long ab=B;
deque<int> rm;
for(int l=0;l<R;l++){
rm.push_back(abs(i-X[l]));
}
sort(rm.begin(),rm.end());
long tm=rm.size();
for(int l=0;l<tm;l++){if(ab-rm[l]>=0){au++;ab=ab-rm[l];}else break;}
mx=max(mx,au);
}
R=mx;
return R;
}
# | 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... |