Submission #460578

#TimeUsernameProblemLanguageResultExecution timeMemory
460578fuad27Rice Hub (IOI11_ricehub)C++14
100 / 100
20 ms1756 KiB
#include "ricehub.h" #include<bits/stdc++.h> using namespace std; int besthub(int R, int L, int x[], long long B) { int MAX = 0; long long c = 0; for(int i = 0, j = 0;j<R;j++) { c += x[j] - x[(i + j)/2]; while(B - c < 0) { c -= x[(i + 1 + j)/2] - x[i]; i++; } MAX = max(MAX, j-i+1); } return MAX; }/* int main () { int X[5] = {1, 2, 10, 12, 14}; cerr<<besthub(5, 20, X, 6); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...