結果

問題 No.2093 Shio Ramen
ユーザー ニックネームニックネーム
提出日時 2022-10-07 21:30:47
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 279 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-09-03 00:24:11
合計ジャッジ時間 5,133 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,780 KB
testcase_01 AC 14 ms
7,868 KB
testcase_02 AC 14 ms
7,856 KB
testcase_03 AC 14 ms
7,832 KB
testcase_04 AC 14 ms
7,864 KB
testcase_05 AC 15 ms
7,792 KB
testcase_06 AC 15 ms
7,808 KB
testcase_07 AC 15 ms
7,852 KB
testcase_08 AC 15 ms
7,916 KB
testcase_09 AC 45 ms
7,800 KB
testcase_10 AC 200 ms
7,856 KB
testcase_11 AC 25 ms
7,916 KB
testcase_12 AC 38 ms
7,880 KB
testcase_13 AC 23 ms
7,912 KB
testcase_14 AC 32 ms
7,832 KB
testcase_15 AC 143 ms
7,964 KB
testcase_16 AC 67 ms
7,872 KB
testcase_17 AC 45 ms
7,792 KB
testcase_18 AC 279 ms
7,780 KB
testcase_19 AC 173 ms
7,828 KB
testcase_20 AC 103 ms
7,776 KB
testcase_21 AC 133 ms
7,828 KB
testcase_22 AC 129 ms
7,944 KB
testcase_23 AC 262 ms
7,876 KB
testcase_24 AC 254 ms
7,776 KB
testcase_25 AC 276 ms
7,884 KB
testcase_26 AC 275 ms
7,856 KB
testcase_27 AC 274 ms
7,796 KB
testcase_28 AC 261 ms
7,824 KB
testcase_29 AC 258 ms
7,776 KB
testcase_30 AC 256 ms
7,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, i = map(int, input().split())
dp = [0]*(i+1)
for _ in range(n):
    s, a = map(int, input().split())
    for j in range(i-s, -1, -1):
        dp[j+s] = max(dp[j+s], dp[j]+a)
print(max(dp))
0