結果

問題 No.118 門松列(2)
ユーザー hogeover30
提出日時 2015-01-28 20:08:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 894 ms
コンパイル使用メモリ 54,872 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 06:52:45
合計ジャッジ時間 1,745 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
typedef long long ll;
using namespace std;
int main()
{
    int n;
    while (cin>>n) {
        ll a[101]={};
        while (n--) {
            int t; cin>>t; a[t]++;
        }
        ll res=0;
        const int mod=1e9+7;
        for(int i=1;i<=100;++i) for(int j=i+1;j<=100;++j) for(int k=j+1;k<=100;++k)
            res=(res+(ll)a[i]*a[j]%mod*a[k])%mod;
        cout<<res<<endl;
    }
}
0