이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
const ll sz=50005;
ll a[sz], b[sz], d[sz], s[sz];
int besthub(int r, int l, int x[], long long k)
{
ll ans=0;
for(int i=0; i<r; i++){
vector<ll>v;
for(int j=0; j<r; j++){
v.push_back(abs(x[i]-x[j]));
}
sort(v.begin(), v.end());
ll sum=0;
for(int j=0; j<r; j++){
if(sum+v[j]>k) break;
sum+=v[j];
ans=max(ans, (ll)j+1);
}
}
return ans;
}
/*
{} []
5 20 6
1 2 10 12 14 3
*/
# | 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... |