結果

問題 No.1416 ショッピングモール
ユーザー harurunharurun
提出日時 2020-12-17 11:11:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 192 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 19,104 KB
最終ジャッジ日時 2023-10-20 11:24:31
合計ジャッジ時間 3,997 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,020 KB
testcase_01 AC 28 ms
10,020 KB
testcase_02 AC 30 ms
10,020 KB
testcase_03 AC 32 ms
10,024 KB
testcase_04 AC 31 ms
10,020 KB
testcase_05 AC 30 ms
10,052 KB
testcase_06 AC 32 ms
10,024 KB
testcase_07 AC 28 ms
10,056 KB
testcase_08 AC 30 ms
10,120 KB
testcase_09 AC 29 ms
10,020 KB
testcase_10 AC 28 ms
10,020 KB
testcase_11 AC 40 ms
10,400 KB
testcase_12 AC 29 ms
10,052 KB
testcase_13 AC 41 ms
10,412 KB
testcase_14 AC 46 ms
10,468 KB
testcase_15 AC 79 ms
10,740 KB
testcase_16 AC 47 ms
10,480 KB
testcase_17 AC 102 ms
10,844 KB
testcase_18 AC 99 ms
10,840 KB
testcase_19 AC 111 ms
10,868 KB
testcase_20 AC 95 ms
10,888 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=0
cnt=0
N=n
for i in range(n):
  a=min(pow(2,i),N)
  for j in range(a):
    ans+=i*A[cnt]
    cnt+=1
  N-=a
print(ans)
0