結果

問題 No.118 門松列(2)
ユーザー kyuna
提出日時 2019-07-28 03:38:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 538 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 72,004 KB
実行使用メモリ 6,812 KB
最終ジャッジ日時 2024-07-02 14:56:02
合計ジャッジ時間 1,470 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int MOD = (int)1e9 + 7;

int main() {
    int n; cin >> n;
    vector<int> a(n);
    for (int &ai: a) cin >> ai;
    vector<int> cnt(101);
    for (int ai: a) cnt[ai]++;
    long long ans = 0;
    for (int i = 1; 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;
    return 0;
}
0