結果

問題 No.2317 Expression Menu
ユーザー 倉
提出日時 2023-05-26 22:12:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 484 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 92,748 KB
最終ジャッジ日時 2023-08-26 11:54:58
合計ジャッジ時間 12,392 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,412 KB
testcase_01 AC 76 ms
71,396 KB
testcase_02 AC 103 ms
78,948 KB
testcase_03 AC 225 ms
91,196 KB
testcase_04 AC 233 ms
92,608 KB
testcase_05 AC 254 ms
92,116 KB
testcase_06 AC 222 ms
92,164 KB
testcase_07 AC 242 ms
92,264 KB
testcase_08 AC 223 ms
91,936 KB
testcase_09 AC 255 ms
92,748 KB
testcase_10 AC 239 ms
92,164 KB
testcase_11 AC 235 ms
92,092 KB
testcase_12 AC 236 ms
92,708 KB
testcase_13 AC 228 ms
92,048 KB
testcase_14 AC 272 ms
92,684 KB
testcase_15 AC 244 ms
92,004 KB
testcase_16 AC 257 ms
91,248 KB
testcase_17 AC 258 ms
92,168 KB
testcase_18 AC 242 ms
91,988 KB
testcase_19 AC 262 ms
92,516 KB
testcase_20 AC 269 ms
92,504 KB
testcase_21 AC 238 ms
92,316 KB
testcase_22 AC 242 ms
92,244 KB
testcase_23 AC 449 ms
90,984 KB
testcase_24 AC 430 ms
90,308 KB
testcase_25 AC 421 ms
91,560 KB
testcase_26 AC 414 ms
92,040 KB
testcase_27 AC 413 ms
92,152 KB
testcase_28 AC 427 ms
90,364 KB
testcase_29 AC 442 ms
91,548 KB
testcase_30 AC 436 ms
90,976 KB
testcase_31 AC 484 ms
90,604 KB
testcase_32 AC 414 ms
91,180 KB
testcase_33 AC 77 ms
71,384 KB
testcase_34 AC 76 ms
71,384 KB
testcase_35 AC 81 ms
75,220 KB
testcase_36 AC 76 ms
71,288 KB
testcase_37 AC 76 ms
71,624 KB
testcase_38 AC 273 ms
92,184 KB
testcase_39 AC 273 ms
92,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())

L = [list(map(int, input().split())) for _ in range(N)]

DP = [[-1] * (X+1) for _ in range(Y+1)]
DP[0][0] = 0

for i in range(N):
    nxt = [[-1] * (X+1) for _ in range(Y+1)]
    a, b, c = L[i]
    for x in range(X)[::-1]:
        if a + x > X: continue
        for y in range(Y)[::-1]:
            if b + y > Y: continue
            if DP[x][y] < 0: continue
            DP[a+x][b+y] = max(DP[a+x][b+y], DP[x][y] + c)

ans = 0
for d in DP:
    ans = max(ans, max(d))
            
print(ans)
0