結果
| 問題 | No.1416 ショッピングモール | 
| コンテスト | |
| ユーザー |  ytft | 
| 提出日時 | 2022-03-18 09:43:51 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 74 ms / 1,000 ms | 
| コード長 | 219 bytes | 
| コンパイル時間 | 205 ms | 
| コンパイル使用メモリ | 82,440 KB | 
| 実行使用メモリ | 73,480 KB | 
| 最終ジャッジ日時 | 2024-10-02 12:11:38 | 
| 合計ジャッジ時間 | 2,242 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
import sys input=lambda:sys.stdin.readline().rstrip() N=int(input()) A=sorted(list(map(int,input().split())),key=lambda x:-x) ans,i=0,0 while pow(2,i)-1<N: ans+=i*sum(A[pow(2,i)-1:min(pow(2,i+1)-1,N)]) i+=1 print(ans)
