This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
typedef long long ll;
int max(int x,int y){return x>y?x:y;}
int besthub(int N, int Eyfa, int X[], long long B){
X[N]=X[N-1];
int l=0,r=0,mid=0,ret=0;
ll sum=0;
bool ok=0;
while(r<N){
while(r<N&&sum<=B){
if(ok)mid++;
r++;
sum+=X[r]-X[mid];
ok=!ok;
ret=max(ret,r-l);
}
while(sum>B){
if(ok)mid++;
sum-=X[mid]-X[l];
l++;
ok=!ok;
}
}
return ret;
}
# | 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... |