結果

問題 No.2093 Shio Ramen
ユーザー lllllll88938494
提出日時 2023-03-24 02:00:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 67,804 KB
最終ジャッジ日時 2024-09-18 15:49:46
合計ジャッジ時間 2,449 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n,l=map(int,input().split())

dp = [-1]*(l+1)
dp[0] = 0

for i in range(n):
    s,a=map(int,input().split())
    for j in range(l,0,-1):
        if j - s >= 0 and dp[j-s] != -1:
            dp[j] = max(dp[j-s] + a,dp[j])
            
print(max(dp))
0