結果

問題 No.2093 Shio Ramen
ユーザー ああいいああいい
提出日時 2022-10-08 20:55:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 76,932 KB
最終ジャッジ日時 2023-09-05 02:27:29
合計ジャッジ時間 5,067 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,988 KB
testcase_01 AC 76 ms
71,368 KB
testcase_02 AC 75 ms
71,368 KB
testcase_03 AC 74 ms
71,108 KB
testcase_04 AC 75 ms
71,296 KB
testcase_05 AC 75 ms
71,164 KB
testcase_06 AC 75 ms
71,404 KB
testcase_07 AC 76 ms
71,244 KB
testcase_08 AC 77 ms
71,256 KB
testcase_09 AC 141 ms
76,644 KB
testcase_10 AC 98 ms
76,672 KB
testcase_11 AC 83 ms
75,900 KB
testcase_12 AC 93 ms
76,780 KB
testcase_13 AC 93 ms
76,632 KB
testcase_14 AC 94 ms
76,892 KB
testcase_15 AC 95 ms
76,588 KB
testcase_16 AC 93 ms
76,624 KB
testcase_17 AC 95 ms
76,444 KB
testcase_18 AC 100 ms
76,812 KB
testcase_19 AC 97 ms
76,700 KB
testcase_20 AC 97 ms
76,640 KB
testcase_21 AC 98 ms
76,888 KB
testcase_22 AC 97 ms
76,852 KB
testcase_23 AC 100 ms
76,816 KB
testcase_24 AC 99 ms
76,852 KB
testcase_25 AC 99 ms
76,904 KB
testcase_26 AC 99 ms
76,608 KB
testcase_27 AC 100 ms
76,784 KB
testcase_28 AC 97 ms
76,896 KB
testcase_29 AC 96 ms
76,932 KB
testcase_30 AC 98 ms
76,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,I = map(int,input().split())

inf = 10 ** 10
dp = [-inf] * (I + 1)
dp[0] = 0
for _ in range(N):
    s,a = map(int,input().split())
    for i in range(I,-1,-1):
        if i + s <= I:
            dp[i + s] = max(dp[i + s],dp[i] + a)
print(max(dp))
0