結果

問題 No.2317 Expression Menu
ユーザー ntudantuda
提出日時 2023-05-27 11:35:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 598 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 77,996 KB
最終ジャッジ日時 2023-08-26 19:49:20
合計ジャッジ時間 16,566 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,128 KB
testcase_01 AC 69 ms
71,332 KB
testcase_02 AC 103 ms
77,476 KB
testcase_03 AC 268 ms
77,200 KB
testcase_04 AC 260 ms
77,600 KB
testcase_05 AC 262 ms
77,428 KB
testcase_06 AC 267 ms
77,696 KB
testcase_07 AC 240 ms
77,472 KB
testcase_08 AC 270 ms
77,508 KB
testcase_09 AC 262 ms
77,648 KB
testcase_10 AC 280 ms
77,540 KB
testcase_11 AC 284 ms
77,728 KB
testcase_12 AC 251 ms
77,996 KB
testcase_13 AC 260 ms
77,300 KB
testcase_14 AC 258 ms
77,548 KB
testcase_15 AC 246 ms
77,552 KB
testcase_16 AC 305 ms
77,812 KB
testcase_17 AC 291 ms
77,684 KB
testcase_18 AC 238 ms
77,632 KB
testcase_19 AC 307 ms
77,432 KB
testcase_20 AC 320 ms
77,652 KB
testcase_21 AC 265 ms
77,640 KB
testcase_22 AC 243 ms
77,672 KB
testcase_23 AC 597 ms
77,544 KB
testcase_24 AC 594 ms
77,376 KB
testcase_25 AC 598 ms
77,512 KB
testcase_26 AC 598 ms
77,560 KB
testcase_27 AC 589 ms
77,712 KB
testcase_28 AC 597 ms
77,532 KB
testcase_29 AC 595 ms
77,684 KB
testcase_30 AC 590 ms
77,740 KB
testcase_31 AC 595 ms
77,428 KB
testcase_32 AC 593 ms
77,628 KB
testcase_33 AC 70 ms
70,964 KB
testcase_34 AC 69 ms
71,148 KB
testcase_35 AC 72 ms
71,156 KB
testcase_36 AC 71 ms
71,292 KB
testcase_37 AC 70 ms
70,860 KB
testcase_38 AC 524 ms
77,612 KB
testcase_39 AC 474 ms
77,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())
ABC = [list(map(int, input().split())) for _ in range(N)]
# dp[i][j]:= メニュー枠をi, 容量をj使用して上がるかわいさ

dp = [[0] * (Y + 1) for _ in range(X + 1)]

for a, b, c in ABC:
    for i in reversed(range(X)):
        if i + a <= X:
            for j in reversed(range(Y)):
                if j + b <= Y:
                    dp[i + a][j + b] = max(dp[i + a][j + b], dp[i][j] + c)
print(dp[X][Y])
0