| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1334106 | abdiskiosk | 쌀 창고 (IOI11_ricehub) | C++20 | 0 ms | 0 KiB |
//
// Created by Oscar Stougaard on 09/03/2026.
//
using namespace std;
#include <vector>
#include <algorithm>
#include <iostream>
int main() {
int r; cin >> r;
int l; cin >> l;
vector<int> x(r);
for (int i = 0; i < r; i++) {
cin >> x[i];
}
long long b; cin >> b;
int ghigh = 0;
for (int i = 0; i < r; i++) {
int lhigh = 0;
for (int j = i; j < r; j++) {
int c = x[j] - x[i];
if (c <= b) {
lhigh = max(lhigh, (j - i) + 1);
}
}
ghigh = max(lhigh, ghigh);
}
cout << ghigh << endl;
return 0;
}