結果

問題 No.2093 Shio Ramen
ユーザー Akijin_007Akijin_007
提出日時 2022-10-07 22:21:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 686 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 77,600 KB
最終ジャッジ日時 2023-09-03 13:20:53
合計ジャッジ時間 4,685 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,072 KB
testcase_01 AC 74 ms
71,348 KB
testcase_02 AC 73 ms
71,288 KB
testcase_03 AC 72 ms
71,576 KB
testcase_04 AC 73 ms
71,224 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
71,100 KB
testcase_08 AC 69 ms
71,576 KB
testcase_09 AC 87 ms
76,840 KB
testcase_10 AC 104 ms
77,296 KB
testcase_11 AC 83 ms
76,180 KB
testcase_12 AC 92 ms
76,500 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 104 ms
77,228 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 113 ms
77,460 KB
testcase_19 WA -
testcase_20 AC 108 ms
77,480 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 112 ms
77,584 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 114 ms
77,492 KB
testcase_28 AC 115 ms
77,360 KB
testcase_29 AC 115 ms
77,432 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N, I = map(int, input().split())

S = [0] * N
for i in range(N):
    S[i] = list(map(int, input().split()))

dp = [0] * (I+1)

for i in range(N):
    ndp = [0] * (I+1)
    s, a = S[i]
    for j in range(I):
        ndp[j] = max(dp[j], ndp[j])
        if j + s <= I:
            ndp[j+s] = max(dp[j] + a, ndp[j+s])
    dp = list(ndp)

# print(dp)
ans = max(dp)
print(ans)
0