結果
| 問題 | No.3077 Goodstuff Deck Builder(Hard) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-20 00:30:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 688 ms / 3,000 ms |
| コード長 | 220 bytes |
| 記録 | |
| コンパイル時間 | 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 |
ソースコード
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))