結果

問題 No.2317 Expression Menu
ユーザー titiatitia
提出日時 2023-05-26 22:18:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 633 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 77,828 KB
最終ジャッジ日時 2023-08-26 12:05:22
合計ジャッジ時間 17,483 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,176 KB
testcase_01 AC 78 ms
71,248 KB
testcase_02 AC 115 ms
76,440 KB
testcase_03 AC 319 ms
77,628 KB
testcase_04 AC 295 ms
76,516 KB
testcase_05 AC 335 ms
77,496 KB
testcase_06 AC 339 ms
77,292 KB
testcase_07 AC 297 ms
76,356 KB
testcase_08 AC 332 ms
77,672 KB
testcase_09 AC 318 ms
77,500 KB
testcase_10 AC 341 ms
77,524 KB
testcase_11 AC 350 ms
77,680 KB
testcase_12 AC 303 ms
77,828 KB
testcase_13 AC 308 ms
76,408 KB
testcase_14 AC 341 ms
77,716 KB
testcase_15 AC 301 ms
77,508 KB
testcase_16 AC 315 ms
76,416 KB
testcase_17 AC 338 ms
76,368 KB
testcase_18 AC 324 ms
77,668 KB
testcase_19 AC 354 ms
77,668 KB
testcase_20 AC 356 ms
77,768 KB
testcase_21 AC 317 ms
77,752 KB
testcase_22 AC 293 ms
77,740 KB
testcase_23 AC 621 ms
77,556 KB
testcase_24 AC 624 ms
77,600 KB
testcase_25 AC 621 ms
77,536 KB
testcase_26 AC 627 ms
77,660 KB
testcase_27 AC 633 ms
77,452 KB
testcase_28 AC 620 ms
77,760 KB
testcase_29 AC 626 ms
77,760 KB
testcase_30 AC 626 ms
77,552 KB
testcase_31 AC 620 ms
77,776 KB
testcase_32 AC 622 ms
77,596 KB
testcase_33 AC 77 ms
71,428 KB
testcase_34 AC 78 ms
71,428 KB
testcase_35 AC 83 ms
76,400 KB
testcase_36 AC 76 ms
71,172 KB
testcase_37 AC 78 ms
70,924 KB
testcase_38 AC 487 ms
76,496 KB
testcase_39 AC 535 ms
76,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

DP=[[0]*(Y+1) for i in range(X+1)]

for a,b,c in A:
    for i in range(X,-1,-1):
        for j in range(Y,-1,-1):
            if i+a<=X and j+b<=Y:
                DP[i+a][j+b]=max(DP[i+a][j+b],DP[i][j]+c)

ANS=0

for i in range(X+1):
    for j in range(Y+1):
        ANS=max(ANS,DP[i][j])

print(ANS)
0