結果

問題 No.2093 Shio Ramen
ユーザー lllllll88938494lllllll88938494
提出日時 2023-03-24 02:00:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 66,564 KB
最終ジャッジ日時 2023-10-18 19:51:13
合計ジャッジ時間 2,776 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,308 KB
testcase_01 AC 39 ms
53,308 KB
testcase_02 AC 37 ms
53,308 KB
testcase_03 AC 37 ms
53,308 KB
testcase_04 AC 37 ms
53,308 KB
testcase_05 AC 37 ms
53,308 KB
testcase_06 AC 37 ms
53,308 KB
testcase_07 AC 37 ms
53,308 KB
testcase_08 AC 37 ms
53,308 KB
testcase_09 AC 58 ms
66,560 KB
testcase_10 AC 60 ms
66,560 KB
testcase_11 AC 46 ms
61,492 KB
testcase_12 AC 56 ms
66,560 KB
testcase_13 AC 54 ms
64,508 KB
testcase_14 AC 54 ms
64,508 KB
testcase_15 AC 59 ms
66,564 KB
testcase_16 AC 55 ms
66,560 KB
testcase_17 AC 55 ms
66,560 KB
testcase_18 AC 64 ms
66,564 KB
testcase_19 AC 58 ms
66,560 KB
testcase_20 AC 58 ms
66,564 KB
testcase_21 AC 57 ms
66,560 KB
testcase_22 AC 59 ms
66,564 KB
testcase_23 AC 64 ms
66,564 KB
testcase_24 AC 63 ms
66,564 KB
testcase_25 AC 64 ms
66,564 KB
testcase_26 AC 65 ms
66,564 KB
testcase_27 AC 64 ms
66,564 KB
testcase_28 AC 64 ms
66,564 KB
testcase_29 AC 64 ms
66,564 KB
testcase_30 AC 64 ms
66,564 KB
権限があれば一括ダウンロードができます

ソースコード

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