思路:
n!k肯定满足
2
a
1
∗
3
a
2
…
…
∗
n
a
n
2^{a_1}*3^{a_2}……*n^{a_n}
2a1∗3a2……∗nan
我们枚举k来找a的规律
发现是前缀和
求k-1次前缀和,计算出每个a的值,最后再分解质因数来求
c o d e code code
#include<iostream>
#include<cstdio>
#define ll long long
using namespace std;
const ll mod = 1e9 + 9;
ll n, k;
ll a[1010], s[1010];
int main() {
scanf("%lld%lld", &n, &k);
for(ll i = 1; i <= n; i ++) a[i] = 1;
for(ll i = 2; i <= k; i ++)
for(ll j = 1; j <= n; j ++) a[j] += a[j - 1], a[j] %= mod;
for(ll i = 1, j = n; i < n; i ++, j --) {
ll p = j;
for(ll g = 2; g <= p; g ++) {
ll tot = 0;
while(p % g == 0) p /= g, tot ++, tot %= mod;
s[g] += (tot * a[i]) % mod;
s[g] %= mod;
}
}
ll ans = 1;
for(int i = 2; i <= n; i ++) {
if(s[i] == 0) continue;
ans = ans * (s[i] + 1) % mod;
}
printf("%lld", ans);
return 0;
}