| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1329085 | hrantsargsyan | 쌀 창고 (IOI11_ricehub) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long pref[N];
int n;
int check(int x, long long B)
{
int l = 1, r = x;
while (r <= n)
{
if ((pref[r] - pref[r - x / 2]) - (pref[l + x / 2 - 1] - pref[l - 1]) <= B)
{
return true;
}
++l;
++r;
}
return false;
}
int besthub(int R, int L, int X[], long long B)
{
n = R;
pref[0] = 0;
for (int i = 1;i <= n;++i)
{
pref[i] = pref[i - 1] + X[i];
}
int l = 1, r = n;
int ans = -1;
while (l <= r)
{
int mid = (l + r) / 2;
if (check(mid, B))
{
ans = max(ans, mid);
l = mid + 1;
}
else
{
r = mid - 1;
}
}
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
