結果

問題 No.2317 Expression Menu
ユーザー ああいいああいい
提出日時 2023-05-26 21:44:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 383 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 78,792 KB
最終ジャッジ日時 2023-08-26 11:01:36
合計ジャッジ時間 10,564 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,968 KB
testcase_01 AC 71 ms
71,128 KB
testcase_02 AC 93 ms
76,448 KB
testcase_03 AC 181 ms
78,260 KB
testcase_04 AC 173 ms
76,816 KB
testcase_05 AC 196 ms
78,000 KB
testcase_06 AC 166 ms
77,004 KB
testcase_07 AC 184 ms
76,724 KB
testcase_08 AC 169 ms
78,224 KB
testcase_09 AC 196 ms
78,284 KB
testcase_10 AC 182 ms
78,392 KB
testcase_11 AC 184 ms
78,252 KB
testcase_12 AC 186 ms
78,792 KB
testcase_13 AC 164 ms
76,724 KB
testcase_14 AC 209 ms
78,540 KB
testcase_15 AC 182 ms
77,020 KB
testcase_16 AC 194 ms
77,020 KB
testcase_17 AC 187 ms
76,712 KB
testcase_18 AC 175 ms
76,604 KB
testcase_19 AC 203 ms
78,564 KB
testcase_20 AC 209 ms
78,484 KB
testcase_21 AC 179 ms
78,316 KB
testcase_22 AC 180 ms
78,088 KB
testcase_23 AC 383 ms
77,772 KB
testcase_24 AC 363 ms
77,792 KB
testcase_25 AC 358 ms
77,632 KB
testcase_26 AC 346 ms
77,804 KB
testcase_27 AC 356 ms
77,872 KB
testcase_28 AC 365 ms
77,820 KB
testcase_29 AC 380 ms
77,892 KB
testcase_30 AC 378 ms
77,532 KB
testcase_31 AC 357 ms
77,904 KB
testcase_32 AC 355 ms
77,712 KB
testcase_33 AC 68 ms
71,420 KB
testcase_34 AC 67 ms
71,428 KB
testcase_35 AC 71 ms
75,824 KB
testcase_36 AC 68 ms
71,300 KB
testcase_37 AC 69 ms
71,252 KB
testcase_38 AC 229 ms
78,292 KB
testcase_39 AC 226 ms
78,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [[-1] * (Y + 1) for _ in range(X + 1)]
dp[0][0] = 0

for _ in range(N):
    a,b,c = map(int,input().split())

    for x in range(X + 1,-1,-1):
        if x + a > X:continue
        for y in range(Y + 1,-1,-1):
            if y + b > Y:continue
            if dp[x][y] != -1:
                dp[x + a][y + b] = max(dp[x + a][y + b],dp[x][y] + c)
ans = 0
for x in range(X + 1):
    for y in range(Y + 1):
        if dp[x][y] > ans:
            ans = dp[x][y]
print(ans)
0