| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1077140 | juicy | 쌀 창고 (IOI11_ricehub) | C++17 | 17 ms | 4444 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <bits/stdc++.h>
int besthub(int n, int L, int *a, long long b) {
std::vector<long long> pf(n);
for (int i = 0; i < n; ++i) {
pf[i] = (i ? pf[i - 1] : 0LL) + a[i];
}
auto qry = [&](int l, int r) {
int md = (l + r) / 2;
return (md - l + 1) * a[md] - pf[md] + (l ? pf[l - 1] : 0LL) + pf[r] - pf[md] - (r - md) * a[md];
};
int res = 0;
for (int i = 0, j = 0; i < n; ++i) {
while (qry(j, i) > b) {
++j;
}
res = std::max(res, i - j + 1);
}
return res;
}| # | 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... | ||||
