| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1299673 | wojtekmal | 쌀 창고 (IOI11_ricehub) | C++20 | 8 ms | 584 KiB |
#include <bits/stdc++.h>
#include "ricehub.h"
using namespace std;
#define ll long long
int besthub(int R, int L, int X[], long long B)
{
int maxx = 0;
int begg = 0, endd = -1;
int midd = -1;
int parity = 1;
ll cost = 0;
int rice_amount = 0;
while (true)
{
if (parity) midd++;
parity ^= 1;
if (cost <= B)
{
maxx = max(maxx, rice_amount);
endd++;
if (endd == R) break;
rice_amount++;
cost += X[endd] - X[midd];
}
else
{
cost -= X[midd] - X[begg];
begg++;
rice_amount--;
}
}
return maxx;
}| # | 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... | ||||
