結果

問題 No.2203 POWER!!!!!
ユーザー norioc
提出日時 2024-07-04 00:13:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 101,764 KB
最終ジャッジ日時 2024-07-04 00:13:39
合計ジャッジ時間 2,087 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N = int(input())
A = list(map(int, input().split()))

freq = Counter(A)
ans = 0
for k, v in freq.items():
    for i in range(1, 9):
        # k^i の個数
        cnt = v * freq[i]
        ans += pow(k, i) * cnt

print(ans)
0