結果

問題 No.2317 Expression Menu
ユーザー june19312june19312
提出日時 2023-05-27 14:11:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 409 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 78,832 KB
最終ジャッジ日時 2023-08-26 21:04:11
合計ジャッジ時間 12,110 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
70,572 KB
testcase_01 AC 67 ms
70,736 KB
testcase_02 AC 142 ms
75,984 KB
testcase_03 AC 213 ms
78,360 KB
testcase_04 AC 232 ms
77,828 KB
testcase_05 AC 287 ms
77,740 KB
testcase_06 AC 206 ms
78,156 KB
testcase_07 AC 282 ms
78,660 KB
testcase_08 AC 213 ms
78,576 KB
testcase_09 AC 291 ms
78,388 KB
testcase_10 AC 208 ms
78,428 KB
testcase_11 AC 224 ms
78,500 KB
testcase_12 AC 229 ms
77,920 KB
testcase_13 AC 209 ms
77,852 KB
testcase_14 AC 298 ms
78,584 KB
testcase_15 AC 285 ms
78,832 KB
testcase_16 AC 289 ms
77,848 KB
testcase_17 AC 290 ms
77,996 KB
testcase_18 AC 199 ms
78,360 KB
testcase_19 AC 294 ms
78,140 KB
testcase_20 AC 290 ms
78,580 KB
testcase_21 AC 239 ms
78,676 KB
testcase_22 AC 241 ms
78,376 KB
testcase_23 AC 409 ms
78,476 KB
testcase_24 AC 388 ms
78,704 KB
testcase_25 AC 389 ms
78,584 KB
testcase_26 AC 383 ms
78,372 KB
testcase_27 AC 380 ms
78,276 KB
testcase_28 AC 390 ms
78,404 KB
testcase_29 AC 401 ms
78,532 KB
testcase_30 AC 407 ms
78,608 KB
testcase_31 AC 388 ms
78,368 KB
testcase_32 AC 375 ms
78,124 KB
testcase_33 AC 64 ms
71,100 KB
testcase_34 AC 63 ms
71,024 KB
testcase_35 AC 70 ms
75,864 KB
testcase_36 AC 62 ms
71,044 KB
testcase_37 AC 61 ms
70,796 KB
testcase_38 AC 206 ms
77,608 KB
testcase_39 AC 213 ms
77,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y = map(int,input().split())

dp = []

for i in range(X+1):
    dp.append([-1]*(Y+1))

dp[0][0] = 0

for _ in range(N):
    A,B,C = map(int,input().split())
    
    for i in range(X,0,-1):
        for j in range(Y+1):
            if j-B >= 0 and i-A >= 0 and dp[i-A][j-B] != -1:
                dp[i][j] = max(dp[i][j],dp[i-A][j-B]+C)

ans = 0
for i in range(X+1):
    for j in range(Y+1):
        ans = max(ans,dp[i][j])

print(ans)
0