結果

問題 No.118 門松列(2)
ユーザー aaaaaaiu
提出日時 2019-08-06 15:11:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 442 bytes
コンパイル時間 2,131 ms
コンパイル使用メモリ 192,472 KB
最終ジャッジ日時 2025-01-07 10:47:57
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int mod=1e9+7;
    int n;
    cin>>n;
    int cnt[101]{};
    for (int i=0;i<n;i++) {
        int a;
        cin>>a;
        cnt[a]++;
    }
    ll 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 = (ans+(ll)cnt[i]*cnt[j]*cnt[k]%mod)%mod;
    cout<<ans<<endl;
    return 0;
}
0