結果

問題 No.2317 Expression Menu
ユーザー cozy_saunacozy_sauna
提出日時 2023-05-31 00:04:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 669 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 79,344 KB
最終ジャッジ日時 2023-08-28 01:17:05
合計ジャッジ時間 17,272 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,104 KB
testcase_01 AC 70 ms
71,236 KB
testcase_02 AC 106 ms
76,596 KB
testcase_03 AC 338 ms
78,896 KB
testcase_04 AC 327 ms
78,380 KB
testcase_05 AC 348 ms
78,884 KB
testcase_06 AC 346 ms
78,832 KB
testcase_07 AC 293 ms
78,860 KB
testcase_08 AC 344 ms
78,944 KB
testcase_09 AC 331 ms
78,784 KB
testcase_10 AC 349 ms
79,148 KB
testcase_11 AC 364 ms
78,908 KB
testcase_12 AC 312 ms
78,168 KB
testcase_13 AC 343 ms
78,028 KB
testcase_14 AC 339 ms
78,484 KB
testcase_15 AC 315 ms
78,928 KB
testcase_16 AC 348 ms
77,816 KB
testcase_17 AC 336 ms
78,732 KB
testcase_18 AC 327 ms
79,064 KB
testcase_19 AC 348 ms
78,828 KB
testcase_20 AC 372 ms
79,064 KB
testcase_21 AC 333 ms
78,492 KB
testcase_22 AC 304 ms
78,488 KB
testcase_23 AC 668 ms
78,932 KB
testcase_24 AC 669 ms
78,936 KB
testcase_25 AC 667 ms
78,780 KB
testcase_26 AC 661 ms
78,672 KB
testcase_27 AC 663 ms
78,744 KB
testcase_28 AC 665 ms
78,956 KB
testcase_29 AC 667 ms
78,984 KB
testcase_30 AC 665 ms
79,344 KB
testcase_31 AC 664 ms
79,176 KB
testcase_32 AC 665 ms
79,136 KB
testcase_33 AC 68 ms
71,008 KB
testcase_34 AC 68 ms
71,416 KB
testcase_35 AC 77 ms
76,292 KB
testcase_36 AC 71 ms
71,284 KB
testcase_37 AC 72 ms
71,100 KB
testcase_38 AC 502 ms
78,392 KB
testcase_39 AC 572 ms
77,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 1 << 30
N, X, Y = map(int, input().split())

dp = [[-INF] * (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]:
            xx = x + a
            yy = y + b
            if xx <= X and yy <= Y:
                dp[xx][yy] = max(dp[xx][yy], dp[x][y] + c)

ans = 0
for x in range(X + 1):
    for y in range(Y + 1):
        ans = max(ans, dp[x][y])

print(ans)



0