結果

問題 No.1416 ショッピングモール
ユーザー kept1994kept1994
提出日時 2021-08-28 12:50:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 1,000 ms
コード長 288 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 81,012 KB
最終ジャッジ日時 2024-05-01 15:50:02
合計ジャッジ時間 2,243 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,968 KB
testcase_01 AC 33 ms
52,224 KB
testcase_02 AC 34 ms
52,352 KB
testcase_03 AC 34 ms
52,224 KB
testcase_04 AC 35 ms
51,584 KB
testcase_05 AC 35 ms
52,960 KB
testcase_06 AC 33 ms
52,224 KB
testcase_07 AC 33 ms
52,736 KB
testcase_08 AC 36 ms
54,144 KB
testcase_09 AC 34 ms
52,608 KB
testcase_10 AC 37 ms
52,480 KB
testcase_11 AC 44 ms
62,628 KB
testcase_12 AC 36 ms
53,120 KB
testcase_13 AC 41 ms
62,592 KB
testcase_14 AC 42 ms
63,232 KB
testcase_15 AC 43 ms
65,152 KB
testcase_16 AC 44 ms
63,384 KB
testcase_17 AC 47 ms
65,920 KB
testcase_18 AC 47 ms
65,920 KB
testcase_19 AC 45 ms
66,304 KB
testcase_20 AC 43 ms
65,920 KB
testcase_21 AC 75 ms
80,752 KB
testcase_22 AC 71 ms
81,012 KB
testcase_23 AC 68 ms
81,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    ans = 0
    for i in range(1, N + 1):
        ans += (len(bin(i)[2:]) - 1) * A[i - 1]
    print(ans)
    return

if __name__ == '__main__':
    main()
0