이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <algorithm>
using namespace std;
 
int besthub(int R, int L, int X[], long long B) {
  int left=0, right=0, best=0;
  long long total=0;
  while (left != R-1) {
    if (right >= R) break;
    int mid = (left+right)>>1;
    if (total+X[right]-X[mid] <= B) {
      total += X[right]-X[mid];
      best = max(best, right-left+1);
      right++;
    } else {
      total -= X[mid] - X[left];
      left = min(left+1, R-1);
      if (right==R-1) break;
    }
  }
  return best;
}
| # | 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... |