結果

問題 No.2203 POWER!!!!!
ユーザー 👑 kakel-sankakel-san
提出日時 2023-02-03 21:48:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 640 bytes
コンパイル時間 1,751 ms
コンパイル使用メモリ 65,908 KB
実行使用メモリ 37,908 KB
最終ジャッジ日時 2023-09-15 17:31:41
合計ジャッジ時間 4,452 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
22,212 KB
testcase_01 AC 59 ms
22,176 KB
testcase_02 AC 59 ms
22,184 KB
testcase_03 AC 59 ms
22,020 KB
testcase_04 AC 59 ms
21,940 KB
testcase_05 AC 60 ms
24,168 KB
testcase_06 AC 59 ms
22,220 KB
testcase_07 AC 60 ms
24,240 KB
testcase_08 AC 72 ms
20,980 KB
testcase_09 AC 80 ms
24,020 KB
testcase_10 AC 91 ms
29,196 KB
testcase_11 AC 102 ms
28,860 KB
testcase_12 AC 71 ms
22,888 KB
testcase_13 AC 117 ms
35,804 KB
testcase_14 AC 117 ms
37,756 KB
testcase_15 AC 117 ms
37,908 KB
testcase_16 AC 117 ms
35,704 KB
testcase_17 AC 119 ms
37,772 KB
testcase_18 AC 59 ms
22,056 KB
testcase_19 AC 59 ms
22,156 KB
testcase_20 AC 60 ms
24,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = int.Parse(ReadLine());
        var a = NList;

        var count = new int[9];
        foreach (var ai in a) ++count[ai];
        var ans = 0L;
        for (var i = 1; i <= 8; ++i) for (var j = 1; j <= 8; ++j)
        {
            ans += (long)Math.Pow(i, j) * count[i] * count[j];
        }
        WriteLine(ans);
    }
}
0