結果

問題 No.1416 ショッピングモール
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-10 14:08:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 56 ms / 1,000 ms
コード長 232 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 13,916 KB
最終ジャッジ日時 2023-09-08 03:16:45
合計ジャッジ時間 2,420 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,760 KB
testcase_01 AC 15 ms
7,792 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 15 ms
7,760 KB
testcase_04 AC 15 ms
7,792 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 15 ms
7,816 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 16 ms
7,912 KB
testcase_09 AC 15 ms
7,792 KB
testcase_10 AC 15 ms
7,788 KB
testcase_11 AC 18 ms
8,196 KB
testcase_12 AC 15 ms
7,852 KB
testcase_13 AC 18 ms
8,488 KB
testcase_14 AC 19 ms
8,564 KB
testcase_15 AC 21 ms
8,688 KB
testcase_16 AC 19 ms
8,336 KB
testcase_17 AC 22 ms
9,000 KB
testcase_18 AC 22 ms
8,972 KB
testcase_19 AC 23 ms
9,016 KB
testcase_20 AC 22 ms
9,104 KB
testcase_21 AC 54 ms
12,904 KB
testcase_22 AC 56 ms
12,840 KB
testcase_23 AC 52 ms
13,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
a.sort()
n-=1;ans=0;now=1
a.pop()
while n:
    capacity=2**now
    while n and capacity:
        out=a.pop()
        ans+=out*now
        capacity-=1
        n-=1
    now+=1
print(ans)
0