結果

問題 No.2317 Expression Menu
ユーザー yabityabit
提出日時 2023-06-19 12:38:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,544 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 299,692 KB
最終ジャッジ日時 2023-09-09 07:44:47
合計ジャッジ時間 48,704 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,176 KB
testcase_01 AC 71 ms
71,176 KB
testcase_02 AC 191 ms
91,808 KB
testcase_03 AC 1,403 ms
299,416 KB
testcase_04 AC 1,539 ms
298,928 KB
testcase_05 AC 1,394 ms
298,860 KB
testcase_06 AC 1,347 ms
299,216 KB
testcase_07 AC 1,358 ms
299,328 KB
testcase_08 AC 1,432 ms
299,220 KB
testcase_09 AC 1,385 ms
298,992 KB
testcase_10 AC 1,374 ms
299,432 KB
testcase_11 AC 1,404 ms
299,312 KB
testcase_12 AC 1,408 ms
299,440 KB
testcase_13 AC 1,403 ms
298,756 KB
testcase_14 AC 1,424 ms
299,408 KB
testcase_15 AC 1,349 ms
299,220 KB
testcase_16 AC 1,405 ms
299,348 KB
testcase_17 AC 1,133 ms
299,160 KB
testcase_18 AC 1,363 ms
299,292 KB
testcase_19 AC 1,426 ms
299,220 KB
testcase_20 AC 1,414 ms
299,152 KB
testcase_21 AC 1,404 ms
299,240 KB
testcase_22 AC 1,391 ms
299,352 KB
testcase_23 AC 1,537 ms
299,632 KB
testcase_24 AC 1,537 ms
299,408 KB
testcase_25 AC 1,543 ms
299,136 KB
testcase_26 AC 1,534 ms
299,464 KB
testcase_27 AC 1,531 ms
299,692 KB
testcase_28 AC 1,535 ms
299,136 KB
testcase_29 AC 1,536 ms
299,272 KB
testcase_30 AC 1,544 ms
299,272 KB
testcase_31 AC 1,544 ms
299,252 KB
testcase_32 AC 1,528 ms
299,460 KB
testcase_33 AC 74 ms
70,940 KB
testcase_34 AC 73 ms
70,892 KB
testcase_35 AC 79 ms
76,124 KB
testcase_36 AC 73 ms
70,992 KB
testcase_37 AC 74 ms
71,324 KB
testcase_38 AC 1,236 ms
298,800 KB
testcase_39 AC 1,268 ms
299,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y = map(int, input().split())
dp = [[[0]*(Y+1) for _ in range(X+1)] for _ in range(N+1)]
ans = 0
for i in range(N):
    a,b,c = map(int, input().split())
    for j in range(X+1):
        for k in range(Y+1):
            dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k])
            if j+a <= X and k+b <= Y:
                dp[i+1][j+a][k+b] = max(dp[i+1][j+a][k+b], dp[i][j][k]+c)
            ans = max(ans, dp[i+1][j][k])
print(ans)
0