結果

問題 No.1416 ショッピングモール
ユーザー Omura ShunsukeOmura Shunsuke
提出日時 2021-04-04 22:37:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 1,000 ms
コード長 242 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 81,884 KB
最終ジャッジ日時 2023-08-28 09:58:16
合計ジャッジ時間 4,187 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,228 KB
testcase_01 AC 68 ms
71,420 KB
testcase_02 AC 67 ms
71,424 KB
testcase_03 AC 67 ms
71,288 KB
testcase_04 AC 67 ms
71,244 KB
testcase_05 AC 71 ms
71,424 KB
testcase_06 AC 68 ms
71,228 KB
testcase_07 AC 68 ms
71,344 KB
testcase_08 AC 68 ms
71,528 KB
testcase_09 AC 67 ms
71,452 KB
testcase_10 AC 67 ms
71,380 KB
testcase_11 AC 72 ms
76,380 KB
testcase_12 AC 67 ms
71,564 KB
testcase_13 AC 72 ms
76,372 KB
testcase_14 AC 72 ms
76,152 KB
testcase_15 AC 72 ms
76,156 KB
testcase_16 AC 73 ms
76,356 KB
testcase_17 AC 72 ms
76,180 KB
testcase_18 AC 73 ms
76,120 KB
testcase_19 AC 74 ms
76,396 KB
testcase_20 AC 74 ms
76,408 KB
testcase_21 AC 84 ms
80,984 KB
testcase_22 AC 83 ms
81,884 KB
testcase_23 AC 80 ms
81,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)


Beki = 2
cnt  = 0
ans  = 0

for i in range(N):
    if i<Beki-1:
        ans += A[i]*cnt
    else:
        Beki *= 2
        cnt  += 1
        ans  += A[i]*cnt
print(ans)
0