이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
long long int typedef li;
int besthub(int n, int m, int x[], li b)
{
int mx=0,l=0,r=0; li t=0;
for (int i=0;i<n;i++) if (t+(x[i]-x[0])<=b) t+=(x[i]-x[0]),r++;
for (int i=1;i<n;i++)
{
t+=(2*i-l-r)*(x[i]-x[i-1]);
while (t>b) t-=(x[i]-x[l]),l++;
while (r<n && t+(x[r]-x[i])<=b) t+=(x[r]-x[i]),r++;
mx=max(mx,r-l);
}
return mx;
}
| # | 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... |