結果

問題 No.2093 Shio Ramen
ユーザー roarisroaris
提出日時 2022-10-07 21:42:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 1,638 ms
コンパイル使用メモリ 86,296 KB
実行使用メモリ 76,712 KB
最終ジャッジ日時 2023-09-03 01:03:15
合計ジャッジ時間 5,738 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,788 KB
testcase_01 AC 72 ms
71,140 KB
testcase_02 AC 71 ms
71,028 KB
testcase_03 AC 71 ms
71,064 KB
testcase_04 AC 73 ms
71,116 KB
testcase_05 AC 72 ms
70,752 KB
testcase_06 AC 72 ms
71,156 KB
testcase_07 AC 74 ms
70,924 KB
testcase_08 AC 74 ms
71,028 KB
testcase_09 AC 90 ms
76,676 KB
testcase_10 AC 92 ms
76,552 KB
testcase_11 AC 81 ms
75,740 KB
testcase_12 AC 89 ms
76,628 KB
testcase_13 AC 89 ms
76,648 KB
testcase_14 AC 88 ms
76,364 KB
testcase_15 AC 93 ms
76,712 KB
testcase_16 AC 91 ms
76,484 KB
testcase_17 AC 88 ms
76,476 KB
testcase_18 AC 98 ms
76,652 KB
testcase_19 AC 93 ms
76,508 KB
testcase_20 AC 90 ms
76,508 KB
testcase_21 AC 91 ms
76,528 KB
testcase_22 AC 91 ms
76,464 KB
testcase_23 AC 93 ms
76,708 KB
testcase_24 AC 93 ms
76,512 KB
testcase_25 AC 91 ms
76,360 KB
testcase_26 AC 94 ms
76,628 KB
testcase_27 AC 95 ms
76,684 KB
testcase_28 AC 92 ms
76,624 KB
testcase_29 AC 95 ms
76,696 KB
testcase_30 AC 93 ms
76,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, I = map(int, input().split())
dp = [0]*(I+1)

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