結果

問題 No.2203 POWER!!!!!
ユーザー FromBooskaFromBooska
提出日時 2023-03-05 17:05:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 100,768 KB
最終ジャッジ日時 2023-10-18 04:57:06
合計ジャッジ時間 2,601 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,400 KB
testcase_01 AC 41 ms
53,400 KB
testcase_02 AC 42 ms
53,400 KB
testcase_03 AC 42 ms
53,400 KB
testcase_04 AC 42 ms
53,400 KB
testcase_05 AC 42 ms
53,400 KB
testcase_06 AC 41 ms
53,400 KB
testcase_07 AC 42 ms
53,400 KB
testcase_08 AC 50 ms
65,140 KB
testcase_09 AC 59 ms
73,808 KB
testcase_10 AC 67 ms
84,512 KB
testcase_11 AC 79 ms
96,576 KB
testcase_12 AC 50 ms
65,140 KB
testcase_13 AC 84 ms
100,768 KB
testcase_14 AC 84 ms
100,764 KB
testcase_15 AC 83 ms
100,768 KB
testcase_16 AC 83 ms
100,768 KB
testcase_17 AC 83 ms
100,768 KB
testcase_18 AC 41 ms
53,400 KB
testcase_19 AC 83 ms
53,400 KB
testcase_20 AC 67 ms
53,400 KB
権限があれば一括ダウンロードができます

ソースコード

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