結果

問題 No.2203 POWER!!!!!
ユーザー ntudantuda
提出日時 2023-02-05 22:13:26
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 106,220 KB
最終ジャッジ日時 2023-09-17 12:00:42
合計ジャッジ時間 3,653 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,436 KB
testcase_01 AC 95 ms
71,644 KB
testcase_02 AC 96 ms
71,788 KB
testcase_03 AC 95 ms
71,436 KB
testcase_04 AC 95 ms
71,704 KB
testcase_05 AC 94 ms
71,612 KB
testcase_06 AC 97 ms
71,440 KB
testcase_07 AC 95 ms
71,584 KB
testcase_08 AC 106 ms
78,716 KB
testcase_09 AC 114 ms
84,680 KB
testcase_10 AC 119 ms
90,688 KB
testcase_11 AC 129 ms
101,196 KB
testcase_12 AC 104 ms
78,460 KB
testcase_13 AC 137 ms
105,964 KB
testcase_14 AC 138 ms
106,000 KB
testcase_15 AC 138 ms
106,220 KB
testcase_16 AC 136 ms
106,204 KB
testcase_17 AC 134 ms
105,960 KB
testcase_18 AC 95 ms
71,652 KB
testcase_19 AC 95 ms
71,612 KB
testcase_20 AC 96 ms
71,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
from collections import defaultdict
dic = defaultdict(int)
for a in A:
    dic[a] += 1
ans = 0
for i in range(1, 9):
    for j in range(1, 9):
        ans += dic[i] * dic[j] * i ** j
print(ans)
0