結果
| 問題 |
No.3077 Goodstuff Deck Builder(Hard)
|
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2025-03-28 23:22:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 82,592 KB |
| 実行使用メモリ | 221,272 KB |
| 最終ジャッジ日時 | 2025-03-28 23:23:37 |
| 合計ジャッジ時間 | 35,656 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 WA * 10 |
ソースコード
N,M=map(int,input().split())
dp=[0]*(M+1)
np=[0]*(M+1)
L=[]
for i in range(N):
c,d=map(int,input().split())
L.append((c,d))
L.sort()
result=0
for i in range(N):
a,b=L[i][:]
for x in range(a,M+1):
np[x]=max(dp[x-a]+b,np[x])
for x in range(a):
np[x]=dp[x]
w=max(np)
result=max(result,w)
for x in range(M+1):
if 2*x>M:
break
dp[2*x]=np[x]
print(result)
ゼット