結果

問題 No.2203 POWER!!!!!
ユーザー FromBooska
提出日時 2023-03-05 17:05:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 100,736 KB
最終ジャッジ日時 2024-09-18 01:37:55
合計ジャッジ時間 2,219 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

# Ai<8なので全組合せは少ない
# Nは大きいので同じ数が何度も出てくるのでCounter

N = int(input())
A = list(map(int, input().split()))
from collections import Counter
counted = Counter(A)
ans = 0
for num1 in counted:
    for num2 in counted:
        ans += (num1**num2)*counted[num1]*counted[num2]
print(ans)
0