結果
問題 |
No.118 門松列(2)
|
ユーザー |
![]() |
提出日時 | 2016-09-16 14:31:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 552 bytes |
コンパイル時間 | 410 ms |
コンパイル使用メモリ | 54,836 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-17 07:16:01 |
合計ジャッジ時間 | 1,440 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 26 |
ソースコード
#include <iostream> #include <cstdio> using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;i<(n);i++) int n, a[100010]; const int mod = 1e9 + 7; ll conbination(int x){ ll ret = x * (x - 1) * (x - 2) / 6; return ret; } int main(void){ cin >> n; rep(i, n) cin >> a[i]; int cnt[110]; rep(i, 110) cnt[i] = 0; rep(i, n){ cnt[a[i]]++; } int c = 0, k = 1; rep(i, 101){ if(cnt[i] >= 1){ k *= cnt[i]; c++; } } // printf("%d %d\n", c, k); ll ans = conbination(c) * k % mod; // printf("%lld\n", ans); return 0; }