結果

問題 No.2093 Shio Ramen
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-10-07 21:29:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 622 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 77,708 KB
最終ジャッジ日時 2023-09-03 00:14:26
合計ジャッジ時間 4,577 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,308 KB
testcase_01 WA -
testcase_02 AC 71 ms
71,368 KB
testcase_03 WA -
testcase_04 AC 69 ms
71,168 KB
testcase_05 AC 71 ms
71,284 KB
testcase_06 AC 71 ms
71,444 KB
testcase_07 AC 69 ms
71,388 KB
testcase_08 AC 69 ms
71,292 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 91 ms
77,004 KB
testcase_13 AC 91 ms
76,772 KB
testcase_14 AC 93 ms
77,260 KB
testcase_15 WA -
testcase_16 AC 92 ms
77,188 KB
testcase_17 AC 93 ms
77,104 KB
testcase_18 WA -
testcase_19 AC 99 ms
76,960 KB
testcase_20 WA -
testcase_21 AC 98 ms
77,032 KB
testcase_22 AC 97 ms
77,104 KB
testcase_23 WA -
testcase_24 AC 104 ms
77,628 KB
testcase_25 AC 105 ms
77,616 KB
testcase_26 AC 103 ms
77,460 KB
testcase_27 WA -
testcase_28 AC 104 ms
77,388 KB
testcase_29 WA -
testcase_30 AC 106 ms
77,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,I = map(int,input().split())
inf = 10**2
dp = [-inf] * (I+1)
dp[0] = 0
for i in range(n):
    n_dp = [-inf] * (I+1)
    s,a = map(int,input().split())
    for j in range(I+1):
        n_dp[j] = max(n_dp[j],dp[j])
        if j + s <= I:
            n_dp[j+s] = max(n_dp[j+s],dp[j] + a)
    dp = n_dp
import sys
for i in range(I+1):
    if dp[-(i+1)] >= 0:sys.exit(print(dp[-(i+1)]))
0