結果

問題 No.1416 ショッピングモール
ユーザー 8nd5t8nd5t
提出日時 2021-03-05 21:29:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 1,000 ms
コード長 706 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 73,088 KB
最終ジャッジ日時 2024-04-16 08:49:58
合計ジャッジ時間 2,541 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
60,800 KB
testcase_01 AC 60 ms
60,800 KB
testcase_02 AC 58 ms
60,928 KB
testcase_03 AC 56 ms
60,672 KB
testcase_04 AC 57 ms
60,800 KB
testcase_05 AC 57 ms
60,800 KB
testcase_06 AC 57 ms
60,672 KB
testcase_07 AC 56 ms
61,056 KB
testcase_08 AC 57 ms
61,440 KB
testcase_09 AC 57 ms
61,056 KB
testcase_10 AC 58 ms
60,928 KB
testcase_11 AC 64 ms
63,616 KB
testcase_12 AC 60 ms
61,568 KB
testcase_13 AC 62 ms
63,616 KB
testcase_14 AC 62 ms
64,000 KB
testcase_15 AC 63 ms
64,384 KB
testcase_16 AC 63 ms
63,872 KB
testcase_17 AC 64 ms
64,896 KB
testcase_18 AC 65 ms
64,896 KB
testcase_19 AC 64 ms
64,768 KB
testcase_20 AC 64 ms
64,896 KB
testcase_21 AC 77 ms
72,064 KB
testcase_22 AC 78 ms
72,960 KB
testcase_23 AC 73 ms
73,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,math,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right 
from heapq import heappop,heappush,heapify, nlargest
from copy import deepcopy
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_1(): return list(map(lambda x:int(x)-1, sys.stdin.readline().split()))
def inps(): return sys.stdin.readline()
def inpsl(x): tmp = sys.stdin.readline(); return list(tmp[:x])
def err(x): print(x); exit()

n = inp()
a = inpl(); a.sort(reverse=True)
res = 0
f = 1
for i in range(n):
    res += a[i]*(f-1)
    if 2**f == (i+2): f += 1
    # print(f)
print(res)
0