# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139465 | 2019-07-31T19:49:19 Z | Sorting | Rice Hub (IOI11_ricehub) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; long long *x, b; int l, r; int besthub(int _r, int _l, long long *_x, long long _b){ r = _r; l = _l; x = _x; b = _b; int ans = 0; for(int i = 0; i < r; i++){ int j; for(j = i; j < r && x[j] - x[i] <= 2 * b; j++); j--; ans = max(ans, j - i + 1); } return ans; }