結果

問題 No.1416 ショッピングモール
ユーザー 👑 tamatotamato
提出日時 2021-03-05 21:24:45
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 102 ms / 1,000 ms
コード長 363 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 87,436 KB
実行使用メモリ 105,756 KB
最終ジャッジ日時 2023-07-29 00:54:45
合計ジャッジ時間 3,685 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
96,356 KB
testcase_01 AC 87 ms
96,060 KB
testcase_02 AC 89 ms
95,888 KB
testcase_03 AC 87 ms
96,132 KB
testcase_04 AC 84 ms
95,532 KB
testcase_05 AC 86 ms
96,212 KB
testcase_06 AC 87 ms
96,280 KB
testcase_07 AC 87 ms
96,196 KB
testcase_08 AC 86 ms
95,972 KB
testcase_09 AC 86 ms
95,596 KB
testcase_10 AC 87 ms
96,004 KB
testcase_11 AC 89 ms
100,608 KB
testcase_12 AC 86 ms
95,964 KB
testcase_13 AC 89 ms
100,392 KB
testcase_14 AC 90 ms
100,392 KB
testcase_15 AC 91 ms
100,264 KB
testcase_16 AC 89 ms
100,664 KB
testcase_17 AC 91 ms
100,476 KB
testcase_18 AC 91 ms
100,684 KB
testcase_19 AC 91 ms
101,108 KB
testcase_20 AC 89 ms
100,428 KB
testcase_21 AC 102 ms
105,376 KB
testcase_22 AC 102 ms
105,548 KB
testcase_23 AC 97 ms
105,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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

    A.sort(reverse=True)
    F = []
    for i in range(20):
        F.extend([i] * (1 << i))
    ans = 0
    for i in range(N):
        ans += A[i] * F[i]
    print(ans)


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