結果

問題 No.2203 POWER!!!!!
ユーザー 👑 KazunKazun
提出日時 2023-02-03 21:32:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 103,980 KB
最終ジャッジ日時 2023-09-15 17:04:16
合計ジャッジ時間 3,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,340 KB
testcase_01 AC 76 ms
71,204 KB
testcase_02 AC 81 ms
71,192 KB
testcase_03 AC 76 ms
71,132 KB
testcase_04 AC 77 ms
70,852 KB
testcase_05 AC 77 ms
71,116 KB
testcase_06 AC 76 ms
71,144 KB
testcase_07 AC 77 ms
71,188 KB
testcase_08 AC 90 ms
76,872 KB
testcase_09 AC 95 ms
83,488 KB
testcase_10 AC 104 ms
89,924 KB
testcase_11 AC 117 ms
99,988 KB
testcase_12 AC 85 ms
76,996 KB
testcase_13 AC 115 ms
103,632 KB
testcase_14 AC 116 ms
103,564 KB
testcase_15 AC 114 ms
103,980 KB
testcase_16 AC 115 ms
103,500 KB
testcase_17 AC 117 ms
103,724 KB
testcase_18 AC 74 ms
71,116 KB
testcase_19 AC 78 ms
71,088 KB
testcase_20 AC 82 ms
71,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    K=max(A)
    count=[A.count(i) for i in range(K+1)]

    ans=0
    for a in range(K+1):
        for b in range(K+1):
            ans+=count[a]*count[b]*pow(a,b)
    return ans

#==================================================
print(solve())
0