結果

問題 No.1416 ショッピングモール
ユーザー ytftytft
提出日時 2022-03-18 09:43:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 219 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 73,544 KB
最終ジャッジ日時 2024-04-10 10:22:14
合計ジャッジ時間 2,597 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,680 KB
testcase_01 AC 39 ms
52,792 KB
testcase_02 AC 39 ms
52,464 KB
testcase_03 AC 38 ms
52,924 KB
testcase_04 AC 38 ms
52,728 KB
testcase_05 AC 40 ms
52,200 KB
testcase_06 AC 38 ms
51,824 KB
testcase_07 AC 38 ms
53,344 KB
testcase_08 AC 41 ms
53,356 KB
testcase_09 AC 38 ms
52,460 KB
testcase_10 AC 37 ms
53,076 KB
testcase_11 AC 46 ms
60,876 KB
testcase_12 AC 39 ms
52,660 KB
testcase_13 AC 45 ms
59,796 KB
testcase_14 AC 45 ms
61,540 KB
testcase_15 AC 48 ms
62,412 KB
testcase_16 AC 46 ms
60,332 KB
testcase_17 AC 49 ms
61,832 KB
testcase_18 AC 49 ms
62,304 KB
testcase_19 AC 47 ms
61,888 KB
testcase_20 AC 47 ms
61,264 KB
testcase_21 AC 85 ms
72,556 KB
testcase_22 AC 88 ms
73,544 KB
testcase_23 AC 55 ms
73,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
A=sorted(list(map(int,input().split())),key=lambda x:-x)
ans,i=0,0
while pow(2,i)-1<N:
	ans+=i*sum(A[pow(2,i)-1:min(pow(2,i+1)-1,N)])
	i+=1
print(ans)
0