# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
920613 | rainboy | 요리 강좌 (KOI17_cook) | C++17 | 2 ms | 10844 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 + 1], dq[K][N + 1], qu[K][N + 1], 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]--;
for (i = 0; i <= n; i++) {
h1 = h2 = h3 = -1;
for (h = 0; h < k; h++) {
dp[h][i] = (i == 0 ? -t : (cnt[h] ? dq[h][qu[h][head[h]]] : INF));
if (dp[h][i] != INF) {
dp[h][i] += ss[h][i];
if (h1 == -1 || dp[h1][i] > dp[h][i])
h3 = h2, h2 = h1, h1 = h;
else if (h2 == -1 || dp[h2][i] > dp[h][i])
h3 = h2, h2 = h;
else if (h3 == -1 || dp[h3][i] > dp[h][i])
h3 = h;
컴파일 시 표준 에러 (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... |