結果

問題 No.118 門松列(2)
ユーザー kpinkcat
提出日時 2023-10-25 15:54:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,019 bytes
コンパイル時間 1,979 ms
コンパイル使用メモリ 193,040 KB
最終ジャッジ日時 2025-02-17 13:35:36
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;
ll mod = 1e9+7;
uintmax_t combination(unsigned int n, unsigned int r) {
if ( r * 2 > n ) r = n - r;
uintmax_t dividend = 1;
uintmax_t divisor = 1;
for ( unsigned int i = 1; i <= r; ++i ) {
dividend *= (n-i+1);
dividend %= mod;
divisor *= i;
}
return dividend / divisor;
}
int main(){
int n;
ll cnt = 0, mul = 1, ans = 0;
cin >> n;
vector<int> v(101);
for (int i = 0; i < n; i++) {
int t;
cin >> t;
v[t]++;
}
for (int i = 1; i < 101; i++) {
if (v[i]) {
cnt++;
mul *= v[i];
mul %= mod;
}
}
if (cnt < 3) cout << 0 << endl;
else {
ans = cnt*(cnt-1)/6%mod;
ans = ans*(cnt-2)%mod;
cout << ans *mul%mod << endl;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0