結果

問題 No.1416 ショッピングモール
ユーザー m-fukuzaki325
提出日時 2022-02-03 07:00:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 74 ms / 1,000 ms
コード長 333 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 15,640 KB
最終ジャッジ日時 2024-06-11 09:41:02
合計ジャッジ時間 2,220 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
AArr = map(int, input().split())

AArrSort = sorted(AArr, reverse=True)
cost = 0
current = 0
for i in range(n+1):
    for j in range(2 ** i):
        if n == current: 
            break
        else :
            cost += i * AArrSort[current]
            current += 1
    if n == current: 
        break

print(cost)
0