結果

問題 No.2093 Shio Ramen
ユーザー ntudantuda
提出日時 2022-10-08 13:36:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 715 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 77,484 KB
最終ジャッジ日時 2023-09-04 17:55:52
合計ジャッジ時間 5,160 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,440 KB
testcase_01 AC 69 ms
71,072 KB
testcase_02 AC 69 ms
71,344 KB
testcase_03 AC 68 ms
71,308 KB
testcase_04 AC 69 ms
70,912 KB
testcase_05 AC 70 ms
71,072 KB
testcase_06 AC 67 ms
71,092 KB
testcase_07 AC 69 ms
71,108 KB
testcase_08 AC 71 ms
71,232 KB
testcase_09 AC 82 ms
76,224 KB
testcase_10 AC 92 ms
76,252 KB
testcase_11 AC 77 ms
76,028 KB
testcase_12 AC 85 ms
76,480 KB
testcase_13 AC 88 ms
76,592 KB
testcase_14 AC 88 ms
76,676 KB
testcase_15 AC 90 ms
76,496 KB
testcase_16 AC 80 ms
76,104 KB
testcase_17 AC 93 ms
76,360 KB
testcase_18 AC 98 ms
77,044 KB
testcase_19 AC 95 ms
76,688 KB
testcase_20 AC 96 ms
76,672 KB
testcase_21 AC 95 ms
76,796 KB
testcase_22 AC 97 ms
76,856 KB
testcase_23 AC 97 ms
77,268 KB
testcase_24 AC 99 ms
77,484 KB
testcase_25 AC 98 ms
77,364 KB
testcase_26 AC 100 ms
77,304 KB
testcase_27 AC 98 ms
77,268 KB
testcase_28 AC 96 ms
77,408 KB
testcase_29 AC 97 ms
77,348 KB
testcase_30 AC 100 ms
77,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


0