이 제출은 이전 버전의 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 ;
int cost[5010][5010];
int besthub(int R, int L, int X[], long long B){
int ans = 1 ;
for(int i = 1 ; i < R ; ++i){
cost[i][0] = 0 ;
for(int j = 1 ; j < R - i + 1 ; ++j){
cost[i][j] = cost[i][j - 1] + (X[j + i - 1] - X[j / 2 + (i - 1)]) ;
}
}
for(int i = 1 ; i < R ; ++i){
int lo = 1 , hi = R - i , md , best = 1;
while(lo <= hi){
md = (lo + hi) / 2 ;
if(B >= cost[i][md]){
lo = md + 1 ;
best = md + 1 ;
}else{
hi = md - 1 ;
}
}
ans = max(ans , best);
}
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... |