結果
| 問題 | No.1416 ショッピングモール | 
| コンテスト | |
| ユーザー |  H20 | 
| 提出日時 | 2021-03-05 22:39:37 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 53 ms / 1,000 ms | 
| コード長 | 200 bytes | 
| コンパイル時間 | 196 ms | 
| コンパイル使用メモリ | 82,788 KB | 
| 実行使用メモリ | 70,328 KB | 
| 最終ジャッジ日時 | 2024-10-07 03:25:44 | 
| 合計ジャッジ時間 | 1,977 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
N = int(input())
A = list(map(int, input().split())) 
A.sort(reverse=True)
ans = 0
p = 0
cnt=1
for i in range(0,N):
    ans += A[i]*p
    cnt-=1
    if cnt==0:
        p+=1
        cnt=2**p
print(ans)
            
            
            
        