結果
問題 |
No.3076 Goodstuff Deck Builder
|
ユーザー |
|
提出日時 | 2025-04-03 12:12:50 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 449 bytes |
コンパイル時間 | 450 ms |
コンパイル使用メモリ | 81,984 KB |
実行使用メモリ | 61,860 KB |
最終ジャッジ日時 | 2025-04-03 12:12:57 |
合計ジャッジ時間 | 6,453 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 TLE * 1 -- * 30 |
ソースコード
from collections import defaultdict import copy n,m=map(int,input().split()) CD=[list(map(int,input().split())) for _ in range(n)] CD.sort(reverse=True) D=defaultdict(list) D[0].append((0,0)) for c,d in CD: D1=copy.deepcopy(D) for i,J in D.items(): for a,b in J: if i+c*pow(2,b)<=m: D1[i+c*pow(2,b)].append((a+d,b+1)) D=D1 ans=0 for j in D.values(): for a,b in j: ans=max(ans,a) print(ans)