이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include "iostream"
#include "vector"
#include "map"
#include "math.h"
#include "string"
#include "algorithm"
#include "set"
#include <iterator>
#include <string.h>
#include <queue>
#include <list>
using namespace std;
typedef long long ll ;
const ll M = 998244353 ;
const ll oo = 1e13 ;
multiset<int> s ;
int besthub(int R, int L, int X[], long long B){
int ans = 0 ;
for(int i = 0 ; i < R ; ++i){
int md = (X[i] + X[R - 1]) / 2 , co = 0 ;
ll cost = 0 ;
s.clear();
for(int j = 0 ; j < R ; ++j){
s.insert(abs(md - X[j]));
}
for(auto x : s){
cost += x ;
if(cost > B){
break;
}
co++;
}
ans = max(ans , co);
}
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... |