이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Coded by Chirath Nirodha
#include<bits/stdc++.h>
#include "ricehub.h"
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define P push
#define I insert
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const ll mod=1e9+7;
int besthub(int R, int L, int X[], long long B){
int n=R;
ll ans=1;
ll l=0,r=0,cur=0;
while(l<n && r<n){
if(cur<=B){
if(r==n-1)break;
int m=(l+r+1)/2;
cur+=(long long) X[r+1]-(long long) X[m];
r++;
}
else{
if(l==n-1)break;
int m=(l+r+1)/2;
cur-=(long long) X[m]-(long long) X[l];
l++;
}
if(cur<=B)ans=max(ans,r-l+1);
}
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... |