結果

問題 No.2203 POWER!!!!!
ユーザー ermineermine
提出日時 2023-02-13 21:08:43
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 1,902 ms
コンパイル使用メモリ 200,088 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-23 13:22:41
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 9 ms
4,376 KB
testcase_10 AC 15 ms
4,380 KB
testcase_11 AC 22 ms
4,380 KB
testcase_12 AC 5 ms
4,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


int main() {
    int n;
    cin>>n;
    vector<int> a(9);
    for(int i=0; i<n; i++){
        int ai;
        cin>>ai;
        a[ai]++;
    }

    long long ans=0;
    for(int i=1; i<=8; i++){
        for(int j=1; j<=8; j++){
            long long t = pow(i,j);
            ans += a[i]*a[j]*t;
        }
    }

    cout<<ans<<endl;
    return 0;
}
0