Submission #201232

#TimeUsernameProblemLanguageResultExecution timeMemory
201232DavidDamianRice Hub (IOI11_ricehub)C++11
100 / 100
60 ms1784 KiB
#include "ricehub.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define debug(x) cout<<#x<<" = "<<x<<endl int besthub(int N, int L, int X[], ll B) { ll cost=0; int a=0,b=0; int maximum=0; while(b<N){ int mid; if(cost<=B){ maximum=max(maximum,b-a+1); b++; mid=(a+b)/2; if(b<N) cost+=X[b]-X[mid]; } else{ a++; mid=(a+b)/2; cost-=X[mid]-X[a-1]; } } return maximum; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...