結果
| 問題 | No.1416 ショッピングモール | 
| コンテスト | |
| ユーザー |  negibose2020 | 
| 提出日時 | 2021-03-05 22:27:15 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 71 ms / 1,000 ms | 
| コード長 | 334 bytes | 
| コンパイル時間 | 154 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 15,752 KB | 
| 最終ジャッジ日時 | 2024-10-07 02:58:58 | 
| 合計ジャッジ時間 | 1,975 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
# N=int(input())
# if N<=0:print(0)
# else:
#     print(N//100)
n=int(input())
ls=list(map(int,input().split()))
ls.sort()
ans=0
i=0
while len(ls)>0:
    a=2**i
    # print(i,ls)
    while a>0:
        # print(ls,i,a)
        if len(ls)==0:
            break
        ans+=ls.pop()*i
        a-=1
    else:
        i+=1
print(ans)
            
            
            
        