結果

問題 No.2317 Expression Menu
ユーザー minimumminimum
提出日時 2023-05-26 22:01:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 768 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 81,432 KB
最終ジャッジ日時 2023-08-26 11:34:54
合計ジャッジ時間 20,726 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,536 KB
testcase_01 AC 73 ms
71,344 KB
testcase_02 AC 121 ms
78,108 KB
testcase_03 AC 465 ms
80,892 KB
testcase_04 AC 466 ms
80,132 KB
testcase_05 AC 516 ms
81,204 KB
testcase_06 AC 462 ms
80,640 KB
testcase_07 AC 458 ms
80,396 KB
testcase_08 AC 454 ms
80,924 KB
testcase_09 AC 504 ms
80,344 KB
testcase_10 AC 484 ms
81,128 KB
testcase_11 AC 505 ms
81,336 KB
testcase_12 AC 531 ms
79,936 KB
testcase_13 AC 483 ms
81,284 KB
testcase_14 AC 524 ms
81,336 KB
testcase_15 AC 465 ms
80,324 KB
testcase_16 AC 490 ms
81,432 KB
testcase_17 AC 511 ms
81,276 KB
testcase_18 AC 471 ms
80,900 KB
testcase_19 AC 508 ms
80,800 KB
testcase_20 AC 536 ms
80,820 KB
testcase_21 AC 453 ms
80,644 KB
testcase_22 AC 452 ms
80,632 KB
testcase_23 AC 717 ms
78,476 KB
testcase_24 AC 713 ms
78,800 KB
testcase_25 AC 748 ms
78,464 KB
testcase_26 AC 667 ms
78,712 KB
testcase_27 AC 666 ms
78,720 KB
testcase_28 AC 757 ms
78,928 KB
testcase_29 AC 768 ms
78,776 KB
testcase_30 AC 670 ms
78,784 KB
testcase_31 AC 636 ms
78,656 KB
testcase_32 AC 753 ms
78,724 KB
testcase_33 AC 74 ms
71,096 KB
testcase_34 AC 72 ms
71,384 KB
testcase_35 AC 84 ms
76,840 KB
testcase_36 AC 73 ms
71,576 KB
testcase_37 AC 75 ms
71,396 KB
testcase_38 AC 527 ms
78,356 KB
testcase_39 AC 555 ms
78,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = float('inf')
N, X, Y = map(int, input().split())
dp = [[-INF] * (Y + 1) for _ in range(X + 1)]
dp[0][0] = 0

for i in range(N):
    a, b, c = map(int, input().split())
    for x in range(X, -1, -1):
        for y in range(Y, -1, -1):
            if x + a <= X and y + b <= Y:
                if dp[x + a][y + b] < dp[x][y] + c:
                    dp[x + a][y + b] = dp[x][y] + c

ans = -INF
for x in range(X + 1):
    for y in range(Y + 1):
        ans = max(ans, dp[x][y])

print(ans)
0