結果

問題 No.2317 Expression Menu
ユーザー 👑 timitimi
提出日時 2023-05-26 21:33:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 634 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 79,220 KB
最終ジャッジ日時 2023-08-26 10:34:28
合計ジャッジ時間 16,259 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,468 KB
testcase_01 AC 71 ms
71,164 KB
testcase_02 AC 108 ms
76,424 KB
testcase_03 AC 325 ms
78,832 KB
testcase_04 AC 299 ms
78,480 KB
testcase_05 AC 338 ms
79,136 KB
testcase_06 AC 339 ms
79,136 KB
testcase_07 AC 299 ms
78,352 KB
testcase_08 AC 332 ms
78,760 KB
testcase_09 AC 317 ms
78,824 KB
testcase_10 AC 343 ms
79,084 KB
testcase_11 AC 352 ms
78,896 KB
testcase_12 AC 301 ms
78,628 KB
testcase_13 AC 313 ms
78,232 KB
testcase_14 AC 346 ms
78,832 KB
testcase_15 AC 306 ms
79,148 KB
testcase_16 AC 321 ms
78,124 KB
testcase_17 AC 340 ms
78,492 KB
testcase_18 AC 327 ms
79,124 KB
testcase_19 AC 361 ms
79,044 KB
testcase_20 AC 365 ms
78,764 KB
testcase_21 AC 323 ms
79,076 KB
testcase_22 AC 294 ms
78,880 KB
testcase_23 AC 625 ms
79,220 KB
testcase_24 AC 626 ms
79,088 KB
testcase_25 AC 622 ms
78,756 KB
testcase_26 AC 623 ms
79,076 KB
testcase_27 AC 628 ms
78,996 KB
testcase_28 AC 626 ms
78,756 KB
testcase_29 AC 627 ms
79,040 KB
testcase_30 AC 632 ms
78,812 KB
testcase_31 AC 634 ms
79,032 KB
testcase_32 AC 625 ms
78,756 KB
testcase_33 AC 72 ms
71,380 KB
testcase_34 AC 71 ms
71,412 KB
testcase_35 AC 77 ms
76,444 KB
testcase_36 AC 71 ms
71,316 KB
testcase_37 AC 71 ms
71,384 KB
testcase_38 AC 470 ms
78,388 KB
testcase_39 AC 531 ms
78,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y=map(int, input().split())
dp=[[-10**10]*(Y+1) for _ in range(X+1)]
dp[0][0]=0
for _ 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:
        dp[x+a][y+b]=max(dp[x+a][y+b],dp[x][y]+c)
  
ans=0
for i in dp:
  ans=max(ans,max(i))
print(ans)
0