結果

問題 No.2317 Expression Menu
ユーザー rlangevinrlangevin
提出日時 2023-05-26 21:31:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,153 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 102,864 KB
最終ジャッジ日時 2023-08-26 10:28:48
合計ジャッジ時間 29,805 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,324 KB
testcase_01 AC 64 ms
71,364 KB
testcase_02 AC 141 ms
80,216 KB
testcase_03 AC 849 ms
102,136 KB
testcase_04 AC 817 ms
101,816 KB
testcase_05 AC 812 ms
102,124 KB
testcase_06 AC 820 ms
102,404 KB
testcase_07 AC 808 ms
102,532 KB
testcase_08 AC 842 ms
101,484 KB
testcase_09 AC 766 ms
101,736 KB
testcase_10 AC 847 ms
102,508 KB
testcase_11 AC 837 ms
102,388 KB
testcase_12 AC 782 ms
102,616 KB
testcase_13 AC 799 ms
102,864 KB
testcase_14 AC 800 ms
102,180 KB
testcase_15 AC 766 ms
102,408 KB
testcase_16 AC 815 ms
102,028 KB
testcase_17 AC 557 ms
102,284 KB
testcase_18 AC 803 ms
102,280 KB
testcase_19 AC 817 ms
101,444 KB
testcase_20 AC 835 ms
102,420 KB
testcase_21 AC 822 ms
101,704 KB
testcase_22 AC 802 ms
102,272 KB
testcase_23 AC 872 ms
102,200 KB
testcase_24 AC 863 ms
101,240 KB
testcase_25 AC 961 ms
102,260 KB
testcase_26 AC 1,033 ms
101,616 KB
testcase_27 AC 1,153 ms
102,148 KB
testcase_28 AC 862 ms
101,476 KB
testcase_29 AC 863 ms
101,380 KB
testcase_30 AC 1,149 ms
101,932 KB
testcase_31 AC 863 ms
102,544 KB
testcase_32 AC 861 ms
102,316 KB
testcase_33 AC 64 ms
71,364 KB
testcase_34 AC 64 ms
71,224 KB
testcase_35 AC 74 ms
76,160 KB
testcase_36 AC 63 ms
71,396 KB
testcase_37 AC 67 ms
71,568 KB
testcase_38 AC 675 ms
100,504 KB
testcase_39 AC 951 ms
101,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())
inf = 10 ** 18
pre = [[-inf] * (Y + 1) for i in range(X + 1)]
pre[0][0] = 0
for i in range(N):
    A, B, C = map(int, input().split())
    dp = [[-inf] * (Y + 1) for i in range(X + 1)]
    for x in range(X + 1):
        for y in range(Y + 1):
            dp[x][y] = max(dp[x][y], pre[x][y])
            if x >= A and y >= B:
                dp[x][y] = max(dp[x][y], pre[x - A][y - B] + C)
            
    dp, pre = pre, dp
    
ans = 0
for i in range(X + 1):
    for j in range(Y + 1):
        ans = max(ans, pre[i][j])
print(ans)
0