結果
問題 |
No.118 門松列(2)
|
ユーザー |
|
提出日時 | 2015-06-17 23:09:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 22 ms / 5,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 1,355 ms |
コンパイル使用メモリ | 157,936 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 06:59:33 |
合計ジャッジ時間 | 2,498 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll mod = 1e9 + 7; #define rep(i,s,n) for(int i=(s); i<(n);++i) int a[101]={}; const int N=101; int main() { int n;cin>>n; rep(i, 0, n){ int t;cin>>t;a[t]++; } ll cnt=0; rep(i,0,N) rep(j,i+1,N) rep(k, j+1,N) { ll tt = (ll)a[i] * a[j] % mod; cnt += tt*a[k]; cnt %= mod; } cout << cnt << endl; }