結果

問題 No.2317 Expression Menu
ユーザー gr1msl3ygr1msl3y
提出日時 2023-05-28 01:00:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,056 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 97,592 KB
最終ジャッジ日時 2023-08-27 01:55:10
合計ジャッジ時間 28,820 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,276 KB
testcase_01 AC 65 ms
71,104 KB
testcase_02 AC 171 ms
81,348 KB
testcase_03 AC 710 ms
96,592 KB
testcase_04 AC 703 ms
96,068 KB
testcase_05 AC 677 ms
96,776 KB
testcase_06 AC 707 ms
96,624 KB
testcase_07 AC 764 ms
96,780 KB
testcase_08 AC 703 ms
97,120 KB
testcase_09 AC 710 ms
96,616 KB
testcase_10 AC 803 ms
97,272 KB
testcase_11 AC 877 ms
97,516 KB
testcase_12 AC 695 ms
97,304 KB
testcase_13 AC 837 ms
96,800 KB
testcase_14 AC 883 ms
97,160 KB
testcase_15 AC 663 ms
96,700 KB
testcase_16 AC 839 ms
97,024 KB
testcase_17 AC 758 ms
96,140 KB
testcase_18 AC 718 ms
97,208 KB
testcase_19 AC 889 ms
96,864 KB
testcase_20 AC 727 ms
97,304 KB
testcase_21 AC 694 ms
95,852 KB
testcase_22 AC 758 ms
97,272 KB
testcase_23 AC 1,042 ms
97,204 KB
testcase_24 AC 723 ms
97,356 KB
testcase_25 AC 731 ms
97,380 KB
testcase_26 AC 993 ms
97,264 KB
testcase_27 AC 962 ms
97,592 KB
testcase_28 AC 731 ms
97,316 KB
testcase_29 AC 748 ms
96,612 KB
testcase_30 AC 965 ms
97,268 KB
testcase_31 AC 940 ms
97,084 KB
testcase_32 AC 724 ms
96,208 KB
testcase_33 AC 66 ms
71,476 KB
testcase_34 AC 65 ms
71,628 KB
testcase_35 AC 75 ms
76,508 KB
testcase_36 AC 68 ms
71,416 KB
testcase_37 AC 68 ms
71,412 KB
testcase_38 AC 771 ms
97,328 KB
testcase_39 AC 1,056 ms
97,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]

INF = 10**18
dp = [[-INF]*(Y+1) for _ in range(X+1)]
dp[0][0] = 0
for a, b, c in A:
    ndp = [[v for v in d] for d in dp]
    for i in range(X+1):
        for j in range(Y+1):
            if i+a <= X and j+b <= Y:
                ndp[i+a][j+b] = max(ndp[i+a][j+b], dp[i][j]+c)
            dp[i][j] = max(dp[i][j], ndp[i][j])

print(max(max(a) for a in dp))
0