結果

問題 No.2203 POWER!!!!!
ユーザー meruuu61779999meruuu61779999
提出日時 2023-02-03 21:44:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 427 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 105,092 KB
最終ジャッジ日時 2023-09-15 17:25:53
合計ジャッジ時間 3,650 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
71,492 KB
testcase_01 AC 94 ms
71,592 KB
testcase_02 AC 96 ms
71,584 KB
testcase_03 AC 96 ms
71,284 KB
testcase_04 AC 96 ms
71,708 KB
testcase_05 AC 95 ms
71,600 KB
testcase_06 AC 95 ms
71,492 KB
testcase_07 AC 96 ms
71,756 KB
testcase_08 AC 103 ms
78,656 KB
testcase_09 AC 111 ms
85,116 KB
testcase_10 AC 119 ms
91,340 KB
testcase_11 AC 133 ms
101,408 KB
testcase_12 AC 105 ms
78,804 KB
testcase_13 AC 136 ms
105,048 KB
testcase_14 AC 135 ms
104,700 KB
testcase_15 AC 134 ms
105,092 KB
testcase_16 AC 135 ms
104,872 KB
testcase_17 AC 136 ms
104,788 KB
testcase_18 AC 97 ms
71,504 KB
testcase_19 AC 95 ms
71,552 KB
testcase_20 AC 95 ms
71,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict

inputs = sys.stdin.readline


def main():
    N = int(inputs())
    A = list(map(int, inputs().split()))
    dic = defaultdict(int)
    for a in A:
        dic[a] += 1
    ans = 0
    for i in range(1, 9):
        for j in range(1, 9):
            val = i ** j
            cnt = dic[i] * dic[j]
            ans += val * cnt
    print(ans)


if __name__ == "__main__":
    main()
0