結果

問題 No.3077 Goodstuff Deck Builder(Hard)
コンテスト
ユーザー ああ
提出日時 2026-05-20 00:30:26
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 688 ms / 3,000 ms
コード長 220 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 222 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 139,904 KB
最終ジャッジ日時 2026-05-20 00:30:53
合計ジャッジ時間 16,085 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,m=map(int,input().split())
dp=[0]*(m+1)
x=[list(map(int,input().split())) for i in range(n)]
x.sort()
for i,j in x:
    for l in range(m-i,-1,-1):
    	if l*2+i<=m:
    		dp[l*2+i]=max(dp[l*2+i],dp[l]+j)
print(max(dp))
0