結果

問題 No.2317 Expression Menu
ユーザー Ekiben542Ekiben542
提出日時 2023-05-26 21:39:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 460 bytes
コンパイル時間 627 ms
コンパイル使用メモリ 10,800 KB
実行使用メモリ 14,284 KB
最終ジャッジ日時 2023-08-26 10:49:44
合計ジャッジ時間 29,898 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,252 KB
testcase_01 AC 15 ms
7,916 KB
testcase_02 AC 73 ms
8,756 KB
testcase_03 AC 1,050 ms
10,676 KB
testcase_04 AC 965 ms
10,376 KB
testcase_05 AC 1,288 ms
11,280 KB
testcase_06 AC 990 ms
10,916 KB
testcase_07 AC 1,110 ms
10,672 KB
testcase_08 AC 1,048 ms
10,576 KB
testcase_09 AC 1,316 ms
10,872 KB
testcase_10 AC 1,214 ms
10,644 KB
testcase_11 AC 1,364 ms
10,944 KB
testcase_12 AC 1,256 ms
11,004 KB
testcase_13 AC 1,232 ms
11,016 KB
testcase_14 AC 1,741 ms
11,400 KB
testcase_15 AC 1,103 ms
10,744 KB
testcase_16 AC 1,284 ms
11,172 KB
testcase_17 AC 1,323 ms
11,208 KB
testcase_18 AC 1,109 ms
10,604 KB
testcase_19 AC 1,502 ms
11,256 KB
testcase_20 AC 1,566 ms
11,400 KB
testcase_21 AC 1,046 ms
10,996 KB
testcase_22 AC 1,021 ms
10,652 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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())
    for i in range(X - A, -1, -1):
        for j in range(Y - B, -1, -1):
            if dp[i][j] != -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):
        if dp[i][j] != -1:
            ans = max(ans, dp[i][j])
print(ans)
0