Submission #724758

#TimeUsernameProblemLanguageResultExecution timeMemory
724758Yell0Rice Hub (IOI11_ricehub)C++17
0 / 100
2 ms468 KiB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int MN=1e5+2;

int besthub(int R,int L,int X[],ll B) {
  int ans=1;
  ll cost=0;
  for(int l=0,r=0;r<R;++r) {
    cost+=X[r]-X[(l+r-1)/2];
    while(cost>B) {
      cost-=X[(l+r)/2+1]-X[l];
      ++l;
    }
    ans=max(ans,r-l+1);
  }
  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...