結果

問題 No.2317 Expression Menu
ユーザー qibqib
提出日時 2023-05-30 21:07:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 385 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 78,260 KB
最終ジャッジ日時 2023-08-28 01:06:38
合計ジャッジ時間 9,886 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,368 KB
testcase_01 AC 72 ms
71,184 KB
testcase_02 AC 90 ms
76,568 KB
testcase_03 AC 141 ms
76,380 KB
testcase_04 AC 141 ms
76,628 KB
testcase_05 AC 153 ms
76,376 KB
testcase_06 AC 145 ms
76,272 KB
testcase_07 AC 149 ms
76,560 KB
testcase_08 AC 146 ms
76,380 KB
testcase_09 AC 152 ms
76,572 KB
testcase_10 AC 150 ms
76,756 KB
testcase_11 AC 159 ms
76,660 KB
testcase_12 AC 152 ms
76,456 KB
testcase_13 AC 147 ms
76,740 KB
testcase_14 AC 167 ms
76,664 KB
testcase_15 AC 147 ms
76,684 KB
testcase_16 AC 151 ms
76,244 KB
testcase_17 AC 154 ms
76,588 KB
testcase_18 AC 199 ms
76,568 KB
testcase_19 AC 160 ms
76,600 KB
testcase_20 AC 163 ms
76,844 KB
testcase_21 AC 143 ms
76,452 KB
testcase_22 AC 142 ms
76,556 KB
testcase_23 AC 385 ms
78,140 KB
testcase_24 AC 369 ms
77,968 KB
testcase_25 AC 365 ms
77,748 KB
testcase_26 AC 360 ms
78,260 KB
testcase_27 AC 354 ms
77,936 KB
testcase_28 AC 370 ms
78,048 KB
testcase_29 AC 379 ms
77,888 KB
testcase_30 AC 372 ms
78,052 KB
testcase_31 AC 359 ms
77,908 KB
testcase_32 AC 353 ms
78,012 KB
testcase_33 AC 72 ms
71,340 KB
testcase_34 AC 72 ms
71,416 KB
testcase_35 AC 79 ms
76,452 KB
testcase_36 AC 72 ms
71,528 KB
testcase_37 AC 73 ms
71,308 KB
testcase_38 AC 199 ms
76,704 KB
testcase_39 AC 230 ms
76,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 1 << 60

n, x, y = map(int, input().split())

items = [list(map(int, input().split())) for _ in range(n)]

dp = [[- INF for _ in range(y + 1)] for _ in range(x + 1)]
dp[0][0] = 0
for ai, bi, ci in items:
  for i in range(x, ai - 1, -1):
    for j in range(y, bi - 1, -1):
      if dp[i - ai][j - bi] < 0:
        continue
      dp[i][j] = max(dp[i][j], dp[i - ai][j - bi] + ci)

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

print(ans)
0