結果

問題 No.2317 Expression Menu
ユーザー sepa38sepa38
提出日時 2023-05-26 21:28:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 583 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 79,072 KB
最終ジャッジ日時 2023-08-26 10:16:36
合計ジャッジ時間 13,835 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,268 KB
testcase_01 AC 65 ms
71,164 KB
testcase_02 AC 94 ms
77,784 KB
testcase_03 AC 224 ms
78,388 KB
testcase_04 AC 219 ms
78,296 KB
testcase_05 AC 227 ms
79,032 KB
testcase_06 AC 224 ms
78,344 KB
testcase_07 AC 181 ms
78,324 KB
testcase_08 AC 233 ms
78,340 KB
testcase_09 AC 192 ms
78,992 KB
testcase_10 AC 240 ms
78,324 KB
testcase_11 AC 244 ms
78,356 KB
testcase_12 AC 196 ms
78,528 KB
testcase_13 AC 223 ms
78,256 KB
testcase_14 AC 248 ms
78,220 KB
testcase_15 AC 188 ms
78,904 KB
testcase_16 AC 229 ms
78,356 KB
testcase_17 AC 230 ms
78,900 KB
testcase_18 AC 292 ms
78,536 KB
testcase_19 AC 243 ms
78,492 KB
testcase_20 AC 251 ms
78,416 KB
testcase_21 AC 230 ms
78,440 KB
testcase_22 AC 192 ms
78,500 KB
testcase_23 AC 578 ms
79,000 KB
testcase_24 AC 577 ms
78,820 KB
testcase_25 AC 580 ms
79,004 KB
testcase_26 AC 583 ms
78,692 KB
testcase_27 AC 572 ms
79,072 KB
testcase_28 AC 579 ms
78,928 KB
testcase_29 AC 579 ms
78,700 KB
testcase_30 AC 578 ms
79,044 KB
testcase_31 AC 577 ms
78,836 KB
testcase_32 AC 571 ms
78,704 KB
testcase_33 AC 69 ms
71,376 KB
testcase_34 AC 69 ms
71,312 KB
testcase_35 AC 75 ms
76,276 KB
testcase_36 AC 70 ms
71,304 KB
testcase_37 AC 70 ms
71,320 KB
testcase_38 AC 546 ms
78,504 KB
testcase_39 AC 487 ms
78,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x, y = map(int, input().split())
inf = 1 << 60
dp = [[-inf] * (y + 1) for _ in range(x+1)]
dp[0][0] = 0
for _ in range(n):
  a, b, c = map(int, input().split())
  for i in reversed(range(x-a+1)):
    for j in reversed(range(y-b+1)):
      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