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;
#define designed ios_base::sync_with_stdio(0);
#define by cin.tie(0);
#define AndreasK cout.tie(0);
#define ii pair <int,int>
#define vi vector <int>
#define iii pair <int,ii>
#define vii vector <ii>
#define vc vector <char>
#define vb vector <bool>
int besthub(int R, int L, int X[], long long B)
{
int mx=0;
for (int f=0;f<R;f++){
int c=X[f];
vi a;
for (int r=0;r<R;r++)
a.push_back(abs(X[r]-c));
sort(a.begin(),a.end());
int ttl=0;
int b=B;
for (int r=0;r<R;r++){
if (a[r]<=b){
b-=a[r];
ttl++;
}
}
mx=max(mx,ttl);
}
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... |