結果

問題 No.2203 POWER!!!!!
ユーザー HydruHydru
提出日時 2023-02-03 21:39:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 104,284 KB
最終ジャッジ日時 2023-09-15 17:17:36
合計ジャッジ時間 2,877 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,096 KB
testcase_01 AC 69 ms
71,368 KB
testcase_02 AC 68 ms
71,400 KB
testcase_03 AC 68 ms
71,188 KB
testcase_04 AC 72 ms
71,184 KB
testcase_05 AC 67 ms
71,276 KB
testcase_06 AC 68 ms
71,172 KB
testcase_07 AC 68 ms
71,164 KB
testcase_08 AC 74 ms
77,512 KB
testcase_09 AC 80 ms
83,896 KB
testcase_10 AC 88 ms
90,600 KB
testcase_11 AC 97 ms
100,612 KB
testcase_12 AC 73 ms
77,580 KB
testcase_13 AC 101 ms
104,116 KB
testcase_14 AC 101 ms
104,284 KB
testcase_15 AC 101 ms
103,996 KB
testcase_16 AC 102 ms
104,012 KB
testcase_17 AC 102 ms
104,072 KB
testcase_18 AC 67 ms
71,372 KB
testcase_19 AC 68 ms
71,460 KB
testcase_20 AC 68 ms
71,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cnt=[0 for _ in range(8)]

for a in A:
    cnt[a-1]+=1

ans=0
for i in range(8):
    for j in range(8):
        ans+=cnt[i]*cnt[j]*(i+1)**(j+1)

print(ans)
0