結果
問題 |
No.1416 ショッピングモール
|
ユーザー |
|
提出日時 | 2021-03-11 13:29:07 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 52 ms / 1,000 ms |
コード長 | 216 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 82,016 KB |
実行使用メモリ | 68,992 KB |
最終ジャッジ日時 | 2024-10-13 02:09:23 |
合計ジャッジ時間 | 2,201 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
n=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) k=0 idx=0 ans=0 while True: for i in range(1<<k): if idx==len(a):break ans+=a[idx]*k idx+=1 if idx==len(a):break k+=1 print(ans)