# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
920643 | rainboy | 요리 강좌 (KOI17_cook) | C++17 | 277 ms | 156572 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/* https://oj.uz/submission/366848 (leinad2) */
/* used solution to find bugs */
#include <stdio.h>
#define N 3000
#define K 3000
#define INF 0x3f3f3f3f
int min(int a, int b) { return a < b ? a : b; }
int main() {
static int ss[K][N + 1], pp[K], dp[K][N], dq[K][N], qu[K][N], head[K], cnt[K];
int n, k, l, r, t, h, h1, h2, h3, h_, i, ans;
scanf("%d%d%d%d%d", &k, &n, &l, &r, &t);
for (h = 0; h < k; h++)
for (i = 1; i <= n; i++)
scanf("%d", &ss[h][i]), ss[h][i] += ss[h][i - 1];
for (h = 0; h < k; h++)
scanf("%d", &pp[h]), pp[h]--;
ans = INF;
for (i = 0; i < n; i++) {
h1 = h2 = h3 = -1;
for (h = 0; h < k; h++) {
if (i >= l && dq[h][i - l] != INF) {
while (cnt[h] && dq[h][qu[h][head[h] + cnt[h] - 1]] >= dq[h][i - l])
cnt[h]--;
qu[h][head[h] + cnt[h]++] = i - l;
}
if (cnt[h] && qu[h][head[h]] == i - r - 1)
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |