結果

問題 No.2093 Shio Ramen
ユーザー 👑 H20H20
提出日時 2022-10-07 22:25:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 846 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 77,448 KB
最終ジャッジ日時 2023-09-03 13:31:32
合計ジャッジ時間 4,851 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,068 KB
testcase_01 AC 70 ms
70,664 KB
testcase_02 AC 71 ms
71,296 KB
testcase_03 AC 71 ms
70,884 KB
testcase_04 AC 70 ms
71,248 KB
testcase_05 AC 71 ms
71,264 KB
testcase_06 AC 72 ms
70,884 KB
testcase_07 AC 72 ms
70,856 KB
testcase_08 AC 71 ms
70,696 KB
testcase_09 AC 89 ms
75,712 KB
testcase_10 AC 107 ms
76,848 KB
testcase_11 AC 79 ms
75,848 KB
testcase_12 AC 93 ms
76,048 KB
testcase_13 AC 94 ms
76,360 KB
testcase_14 AC 96 ms
76,376 KB
testcase_15 AC 105 ms
77,036 KB
testcase_16 AC 88 ms
75,692 KB
testcase_17 AC 102 ms
76,676 KB
testcase_18 AC 113 ms
77,328 KB
testcase_19 AC 109 ms
77,448 KB
testcase_20 AC 107 ms
76,900 KB
testcase_21 AC 107 ms
77,156 KB
testcase_22 AC 110 ms
77,140 KB
testcase_23 AC 114 ms
76,780 KB
testcase_24 AC 114 ms
77,140 KB
testcase_25 AC 114 ms
77,080 KB
testcase_26 AC 114 ms
77,124 KB
testcase_27 AC 112 ms
77,200 KB
testcase_28 AC 111 ms
77,144 KB
testcase_29 AC 112 ms
77,372 KB
testcase_30 AC 114 ms
77,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,I = map(int, input().split())
SI = [list(map(int, input().split())) for _ in range(N)]
DP = [0]*(I+1)
for s,a in SI:
    for i in reversed(range(I)):
        if (i==0 or DP[i]>0) and s+i<=I:
            DP[s+i] = max(DP[i]+a,DP[s+i])
print(max(DP))
0