結果

問題 No.2093 Shio Ramen
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-10-07 21:29:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 77,592 KB
最終ジャッジ日時 2023-09-03 00:16:41
合計ジャッジ時間 4,560 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,332 KB
testcase_01 AC 72 ms
71,392 KB
testcase_02 AC 73 ms
71,552 KB
testcase_03 AC 74 ms
71,284 KB
testcase_04 AC 74 ms
71,284 KB
testcase_05 AC 72 ms
71,428 KB
testcase_06 AC 73 ms
71,552 KB
testcase_07 AC 74 ms
71,232 KB
testcase_08 AC 73 ms
71,480 KB
testcase_09 AC 94 ms
76,872 KB
testcase_10 AC 103 ms
77,044 KB
testcase_11 AC 86 ms
76,100 KB
testcase_12 AC 95 ms
77,276 KB
testcase_13 AC 94 ms
77,068 KB
testcase_14 AC 96 ms
77,076 KB
testcase_15 AC 99 ms
77,052 KB
testcase_16 AC 96 ms
76,860 KB
testcase_17 AC 95 ms
77,080 KB
testcase_18 AC 106 ms
77,540 KB
testcase_19 AC 100 ms
76,952 KB
testcase_20 AC 97 ms
77,100 KB
testcase_21 AC 101 ms
76,788 KB
testcase_22 AC 101 ms
77,168 KB
testcase_23 AC 108 ms
77,480 KB
testcase_24 AC 109 ms
77,384 KB
testcase_25 AC 107 ms
77,496 KB
testcase_26 AC 107 ms
77,384 KB
testcase_27 AC 107 ms
77,564 KB
testcase_28 AC 108 ms
77,500 KB
testcase_29 AC 107 ms
77,592 KB
testcase_30 AC 105 ms
77,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,I = map(int,input().split())
inf = 10**2
dp = [-inf] * (I+1)
dp[0] = 0
for i in range(n):
    n_dp = [-inf] * (I+1)
    s,a = map(int,input().split())
    for j in range(I+1):
        n_dp[j] = max(n_dp[j],dp[j])
        if j + s <= I:
            n_dp[j+s] = max(n_dp[j+s],dp[j] + a)
    dp = n_dp
import sys
print(max(dp))
0