이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "ricehub.h"
#define sz(s) (int)s.size()
using namespace std;
#define ll long long
int besthub(int n, int l, int a[], ll b){
vector <ll> v;
ll ans = 0;
for(int i = 0; i < n; i++){
v.clear();
ll b1 = b, x = 0;
for(int j = 0; j < n; j++){
if(a[i] != a[j]){
v.push_back(abs(a[i]-a[j]));
}
else x++;
}
if(sz(v) > 0){
sort(v.begin(),v.end());
for(auto j : v){
if(j > b1) break;
b1 -= j;
x++;
}
}
ans = max(ans,x);
}
return ans;
}
# | 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... |