結果

問題 No.2093 Shio Ramen
ユーザー 👑 KazunKazun
提出日時 2022-10-07 21:27:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 2,164 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 77,164 KB
最終ジャッジ日時 2023-09-03 00:05:17
合計ジャッジ時間 4,698 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,368 KB
testcase_01 AC 66 ms
71,208 KB
testcase_02 AC 68 ms
71,172 KB
testcase_03 AC 69 ms
71,404 KB
testcase_04 AC 68 ms
71,416 KB
testcase_05 AC 69 ms
71,116 KB
testcase_06 AC 69 ms
71,376 KB
testcase_07 AC 68 ms
71,444 KB
testcase_08 AC 69 ms
71,556 KB
testcase_09 AC 86 ms
77,048 KB
testcase_10 AC 91 ms
76,824 KB
testcase_11 AC 80 ms
75,908 KB
testcase_12 AC 85 ms
76,888 KB
testcase_13 AC 81 ms
76,996 KB
testcase_14 AC 82 ms
77,028 KB
testcase_15 AC 90 ms
77,164 KB
testcase_16 AC 87 ms
76,976 KB
testcase_17 AC 90 ms
77,156 KB
testcase_18 AC 95 ms
77,064 KB
testcase_19 AC 92 ms
76,976 KB
testcase_20 AC 90 ms
76,920 KB
testcase_21 AC 91 ms
76,732 KB
testcase_22 AC 90 ms
76,860 KB
testcase_23 AC 91 ms
76,920 KB
testcase_24 AC 94 ms
77,084 KB
testcase_25 AC 94 ms
76,812 KB
testcase_26 AC 95 ms
77,064 KB
testcase_27 AC 94 ms
76,816 KB
testcase_28 AC 93 ms
76,920 KB
testcase_29 AC 93 ms
77,036 KB
testcase_30 AC 94 ms
76,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N,I=map(int,input().split())

    inf=float("inf")
    DP=[-inf]*(I+1); DP[0]=0

    for _ in range(N):
        s,a=map(int,input().split())
        for t in range(I,s-1,-1):
            DP[t]=max(DP[t], DP[t-s]+a)
    return max(DP)
#==================================================

print(solve())
0