結果

問題 No.2317 Expression Menu
ユーザー iwasikun8iwasikun8
提出日時 2023-05-26 22:22:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,176 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 299,352 KB
最終ジャッジ日時 2023-08-26 12:20:14
合計ジャッジ時間 32,206 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,424 KB
testcase_01 AC 64 ms
71,480 KB
testcase_02 AC 154 ms
91,596 KB
testcase_03 AC 779 ms
299,308 KB
testcase_04 AC 766 ms
299,260 KB
testcase_05 AC 793 ms
299,252 KB
testcase_06 AC 794 ms
299,292 KB
testcase_07 AC 793 ms
299,020 KB
testcase_08 AC 781 ms
299,216 KB
testcase_09 AC 725 ms
299,152 KB
testcase_10 AC 794 ms
299,284 KB
testcase_11 AC 805 ms
299,196 KB
testcase_12 AC 733 ms
299,192 KB
testcase_13 AC 821 ms
299,136 KB
testcase_14 AC 844 ms
299,232 KB
testcase_15 AC 770 ms
299,284 KB
testcase_16 AC 776 ms
299,252 KB
testcase_17 AC 769 ms
299,320 KB
testcase_18 AC 787 ms
299,204 KB
testcase_19 AC 809 ms
299,052 KB
testcase_20 AC 803 ms
299,280 KB
testcase_21 AC 783 ms
299,200 KB
testcase_22 AC 785 ms
299,352 KB
testcase_23 AC 1,123 ms
299,180 KB
testcase_24 AC 870 ms
299,196 KB
testcase_25 AC 881 ms
299,156 KB
testcase_26 AC 1,156 ms
299,196 KB
testcase_27 AC 1,134 ms
299,348 KB
testcase_28 AC 875 ms
299,156 KB
testcase_29 AC 1,176 ms
299,284 KB
testcase_30 AC 1,134 ms
299,272 KB
testcase_31 AC 1,125 ms
299,060 KB
testcase_32 AC 890 ms
299,176 KB
testcase_33 AC 69 ms
71,288 KB
testcase_34 AC 68 ms
71,220 KB
testcase_35 AC 76 ms
76,620 KB
testcase_36 AC 68 ms
71,384 KB
testcase_37 AC 69 ms
71,336 KB
testcase_38 AC 946 ms
299,108 KB
testcase_39 AC 1,072 ms
299,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())
dp = [[[0] * (Y+1) for _ in range(X+1)] for _ in range(N+1)]
for i in range(N):
    A, B, C = map(int, input().split())
    for j in range(X+1):
        for k in range(Y+1):
            if j - A < 0 or k - B < 0:
                dp[i+1][j][k] = dp[i][j][k]
                continue
            dp[i+1][j][k] = max(dp[i][j][k], dp[i][j-A][k-B] + C)

ans = 0
for l in range(X+1):
    ans = max(ans, max(dp[-1][l]))

print(ans)
0