結果

問題 No.2093 Shio Ramen
ユーザー a aa a
提出日時 2022-10-12 09:00:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 486 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 17,192 KB
最終ジャッジ日時 2023-09-08 09:33:52
合計ジャッジ時間 7,995 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,804 KB
testcase_01 AC 17 ms
7,808 KB
testcase_02 AC 18 ms
7,820 KB
testcase_03 AC 16 ms
7,796 KB
testcase_04 AC 16 ms
7,768 KB
testcase_05 AC 16 ms
7,768 KB
testcase_06 AC 16 ms
7,768 KB
testcase_07 AC 16 ms
7,764 KB
testcase_08 AC 16 ms
7,932 KB
testcase_09 AC 70 ms
9,500 KB
testcase_10 AC 323 ms
14,484 KB
testcase_11 AC 33 ms
8,556 KB
testcase_12 AC 54 ms
8,784 KB
testcase_13 AC 32 ms
8,496 KB
testcase_14 AC 50 ms
8,716 KB
testcase_15 AC 238 ms
12,836 KB
testcase_16 AC 102 ms
10,228 KB
testcase_17 AC 71 ms
9,404 KB
testcase_18 AC 475 ms
17,192 KB
testcase_19 AC 297 ms
13,740 KB
testcase_20 AC 168 ms
11,376 KB
testcase_21 AC 218 ms
12,204 KB
testcase_22 AC 220 ms
12,156 KB
testcase_23 AC 456 ms
16,684 KB
testcase_24 AC 461 ms
16,752 KB
testcase_25 AC 455 ms
16,748 KB
testcase_26 AC 461 ms
16,740 KB
testcase_27 AC 461 ms
16,788 KB
testcase_28 AC 476 ms
16,780 KB
testcase_29 AC 474 ms
16,836 KB
testcase_30 AC 486 ms
16,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,l=list(map(int,input().split()))
sa=[list(map(int,input().split())) for _ in range (n)]
dp=[[0]*(l+1) for _ in range(n+1)]
for i,(s,a) in enumerate(sa):
    for j in range(l+1):
        if j>=s:
            dp[i+1][j]=max(dp[i][j],dp[i][j-s]+a)
        else:
            dp[i+1][j]=dp[i][j]
print(dp[-1][-1])
0