結果

問題 No.118 門松列(2)
ユーザー maine_honzukimaine_honzuki
提出日時 2020-05-16 23:16:16
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 499 bytes
コンパイル時間 1,465 ms
コンパイル使用メモリ 166,968 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 05:18:04
合計ジャッジ時間 3,050 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,348 KB
testcase_01 AC 20 ms
4,348 KB
testcase_02 AC 19 ms
4,348 KB
testcase_03 AC 19 ms
4,348 KB
testcase_04 AC 19 ms
4,348 KB
testcase_05 AC 20 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 3 ms
4,348 KB
testcase_09 AC 19 ms
4,348 KB
testcase_10 AC 6 ms
4,348 KB
testcase_11 AC 7 ms
4,348 KB
testcase_12 AC 5 ms
4,348 KB
testcase_13 AC 4 ms
4,348 KB
testcase_14 AC 18 ms
4,348 KB
testcase_15 AC 3 ms
4,348 KB
testcase_16 AC 11 ms
4,348 KB
testcase_17 AC 4 ms
4,348 KB
testcase_18 AC 7 ms
4,348 KB
testcase_19 AC 11 ms
4,348 KB
testcase_20 AC 10 ms
4,348 KB
testcase_21 AC 16 ms
4,348 KB
testcase_22 AC 6 ms
4,348 KB
testcase_23 AC 15 ms
4,348 KB
testcase_24 AC 8 ms
4,348 KB
testcase_25 AC 10 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;

int main() {
    long long N, cnt[110] = {};
    cin >> N;
    for (int i = 0; i < N; i++) {
        int A;
        cin >> A;
        cnt[A]++;
    }

    long long ans = 0;
    for (int i = 0; i <= 100; i++) {
        for (int j = i + 1; j <= 100; j++) {
            for (int k = j + 1; k <= 100; k++) {
                (ans += cnt[i] * cnt[j] * cnt[k]) %= mod;
            }
        }
    }

    cout << ans << endl;
}
0