結果

問題 No.1416 ショッピングモール
ユーザー miya145592miya145592
提出日時 2023-05-10 00:58:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 1,000 ms
コード長 208 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 81,588 KB
最終ジャッジ日時 2023-08-17 12:31:54
合計ジャッジ時間 3,361 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,432 KB
testcase_01 AC 69 ms
70,996 KB
testcase_02 AC 69 ms
71,136 KB
testcase_03 AC 69 ms
71,080 KB
testcase_04 AC 69 ms
71,492 KB
testcase_05 AC 69 ms
71,352 KB
testcase_06 AC 69 ms
71,376 KB
testcase_07 AC 68 ms
71,400 KB
testcase_08 AC 69 ms
71,448 KB
testcase_09 AC 70 ms
71,200 KB
testcase_10 AC 70 ms
71,376 KB
testcase_11 AC 75 ms
76,128 KB
testcase_12 AC 70 ms
71,236 KB
testcase_13 AC 75 ms
76,256 KB
testcase_14 AC 78 ms
76,080 KB
testcase_15 AC 77 ms
75,928 KB
testcase_16 AC 75 ms
76,260 KB
testcase_17 AC 76 ms
76,160 KB
testcase_18 AC 77 ms
76,252 KB
testcase_19 AC 76 ms
76,296 KB
testcase_20 AC 75 ms
76,384 KB
testcase_21 AC 86 ms
80,656 KB
testcase_22 AC 87 ms
81,588 KB
testcase_23 AC 81 ms
81,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
k = 0
i = 0
cnt = 0
ans = 0
while i<N:
    cnt += 2**k
    while i<N and i<cnt:
        ans += A[i]*k
        i+=1
    k+=1
print(ans)
0