結果

問題 No.2317 Expression Menu
ユーザー ShirotsumeShirotsume
提出日時 2023-05-26 21:46:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 793 ms / 2,000 ms
コード長 691 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 95,196 KB
最終ジャッジ日時 2023-08-26 11:05:16
合計ジャッジ時間 23,164 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,852 KB
testcase_01 AC 93 ms
71,644 KB
testcase_02 AC 168 ms
80,124 KB
testcase_03 AC 634 ms
93,876 KB
testcase_04 AC 614 ms
93,548 KB
testcase_05 AC 635 ms
93,596 KB
testcase_06 AC 649 ms
94,120 KB
testcase_07 AC 648 ms
93,968 KB
testcase_08 AC 632 ms
93,544 KB
testcase_09 AC 652 ms
93,752 KB
testcase_10 AC 638 ms
94,292 KB
testcase_11 AC 638 ms
93,724 KB
testcase_12 AC 612 ms
95,196 KB
testcase_13 AC 626 ms
93,496 KB
testcase_14 AC 638 ms
93,432 KB
testcase_15 AC 652 ms
93,884 KB
testcase_16 AC 630 ms
93,404 KB
testcase_17 AC 649 ms
93,476 KB
testcase_18 AC 617 ms
93,752 KB
testcase_19 AC 642 ms
93,740 KB
testcase_20 AC 648 ms
93,708 KB
testcase_21 AC 631 ms
93,440 KB
testcase_22 AC 626 ms
93,560 KB
testcase_23 AC 625 ms
93,624 KB
testcase_24 AC 623 ms
93,736 KB
testcase_25 AC 621 ms
93,452 KB
testcase_26 AC 628 ms
94,112 KB
testcase_27 AC 634 ms
94,016 KB
testcase_28 AC 634 ms
93,664 KB
testcase_29 AC 632 ms
93,852 KB
testcase_30 AC 626 ms
93,808 KB
testcase_31 AC 629 ms
93,740 KB
testcase_32 AC 632 ms
93,632 KB
testcase_33 AC 91 ms
71,876 KB
testcase_34 AC 89 ms
71,620 KB
testcase_35 AC 104 ms
78,148 KB
testcase_36 AC 92 ms
71,672 KB
testcase_37 AC 93 ms
71,460 KB
testcase_38 AC 793 ms
93,976 KB
testcase_39 AC 690 ms
93,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n, x, y = mi()

dp = [[0] * (y + 1) for _ in range(x + 1)]

for _ in range(n):
    e = [[0] * (y + 1) for _ in range(x + 1)]
    a, b, c = mi()
    for i in range(x + 1):
        for j in range(y + 1):
            e[i][j] = max(dp[i][j], e[i][j])
            if i + a <= x and j + b <= y:
                e[i + a][j + b] = max(dp[i][j] + c, e[i + a][j + b])
    dp = e
ans = 0
for i in range(x + 1):
    for j in range(y + 1):
        ans = max(ans, dp[i][j])

print(ans)
0