結果

問題 No.2317 Expression Menu
ユーザー yupoohyupooh
提出日時 2023-05-26 21:30:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 531 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 93,728 KB
最終ジャッジ日時 2023-08-26 10:24:04
合計ジャッジ時間 16,128 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,408 KB
testcase_01 AC 69 ms
71,012 KB
testcase_02 AC 95 ms
79,572 KB
testcase_03 AC 411 ms
92,272 KB
testcase_04 AC 397 ms
92,520 KB
testcase_05 AC 446 ms
92,520 KB
testcase_06 AC 388 ms
92,576 KB
testcase_07 AC 428 ms
92,532 KB
testcase_08 AC 388 ms
92,580 KB
testcase_09 AC 402 ms
92,888 KB
testcase_10 AC 437 ms
93,056 KB
testcase_11 AC 429 ms
92,428 KB
testcase_12 AC 448 ms
91,856 KB
testcase_13 AC 417 ms
92,568 KB
testcase_14 AC 470 ms
92,644 KB
testcase_15 AC 393 ms
92,728 KB
testcase_16 AC 449 ms
92,260 KB
testcase_17 AC 465 ms
92,480 KB
testcase_18 AC 398 ms
92,436 KB
testcase_19 AC 468 ms
92,624 KB
testcase_20 AC 461 ms
92,800 KB
testcase_21 AC 403 ms
92,616 KB
testcase_22 AC 391 ms
92,488 KB
testcase_23 AC 476 ms
92,684 KB
testcase_24 AC 443 ms
92,280 KB
testcase_25 AC 438 ms
93,716 KB
testcase_26 AC 437 ms
92,600 KB
testcase_27 AC 439 ms
91,536 KB
testcase_28 AC 454 ms
93,596 KB
testcase_29 AC 465 ms
93,728 KB
testcase_30 AC 531 ms
92,504 KB
testcase_31 AC 511 ms
92,396 KB
testcase_32 AC 493 ms
92,428 KB
testcase_33 AC 70 ms
71,324 KB
testcase_34 AC 69 ms
71,428 KB
testcase_35 AC 78 ms
76,412 KB
testcase_36 AC 69 ms
71,496 KB
testcase_37 AC 71 ms
71,540 KB
testcase_38 AC 250 ms
92,208 KB
testcase_39 AC 254 ms
92,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
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())
  dp2=[[-1]*(y+1) for _ in range(x+1)]
  for i in range(x+1):
    for j in range(y+1):
      if dp[i][j]==-1:
        continue
      if i+a<=x and j+b<=y:
        dp2[i+a][j+b]=max(dp2[i+a][j+b],dp[i][j]+c)
      dp2[i][j]=max(dp2[i][j],dp[i][j])
  dp=dp2
ans=0
for i in range(x+1):
  for j in range(y+1):
    ans=max(ans,dp[i][j])
print(ans)
0