# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1264261 | liangjeremy | Rice Hub (IOI11_ricehub) | C++20 | 0 ms | 0 KiB |
#include "ricehub.h"
#include<bits/stdc++.h>
#define fi first
#define se second
//#define int long long
using namespace std;
using db=double;
using ll=int64_t;
using sll=__int128;
using lb=long double;
int besthub(int r, int l, int x[], ll b){
int ans=0;
for(int i=1; i<=l; i++){
vector<int>v; int rem=b; int cur=0;
for(int j=0; j<r; j++){
v.push_back(abs(i-x[j]));
}
sort(v.begin(),v.end());
for(auto x:v){
if(rem>=x){
rem-=x; cur++;
}
}
ans=max(ans,cur);
}
return ans;
}