結果

問題 No.2093 Shio Ramen
ユーザー KudeKude
提出日時 2022-10-07 21:26:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 91,196 KB
最終ジャッジ日時 2023-09-02 23:57:08
合計ジャッジ時間 9,677 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 216 ms
89,000 KB
testcase_01 AC 220 ms
89,320 KB
testcase_02 AC 218 ms
89,216 KB
testcase_03 AC 217 ms
88,960 KB
testcase_04 AC 220 ms
89,320 KB
testcase_05 AC 219 ms
89,524 KB
testcase_06 AC 224 ms
89,492 KB
testcase_07 AC 221 ms
89,552 KB
testcase_08 AC 219 ms
89,608 KB
testcase_09 AC 235 ms
91,076 KB
testcase_10 AC 236 ms
90,380 KB
testcase_11 AC 225 ms
89,888 KB
testcase_12 AC 236 ms
90,980 KB
testcase_13 AC 238 ms
91,192 KB
testcase_14 AC 242 ms
90,584 KB
testcase_15 AC 240 ms
90,996 KB
testcase_16 AC 235 ms
90,676 KB
testcase_17 AC 237 ms
91,016 KB
testcase_18 AC 240 ms
91,020 KB
testcase_19 AC 237 ms
90,580 KB
testcase_20 AC 239 ms
91,000 KB
testcase_21 AC 240 ms
90,984 KB
testcase_22 AC 238 ms
91,196 KB
testcase_23 AC 236 ms
90,604 KB
testcase_24 AC 241 ms
90,372 KB
testcase_25 AC 241 ms
90,276 KB
testcase_26 AC 244 ms
90,372 KB
testcase_27 AC 239 ms
91,096 KB
testcase_28 AC 234 ms
90,488 KB
testcase_29 AC 239 ms
90,940 KB
testcase_30 AC 240 ms
91,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from tkinter import RIDGE


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