当前位置:网站首页>【集训DAY11】Calc【数学】
【集训DAY11】Calc【数学】
2022-07-25 22:24:00 【VL——MOESR】

思路:
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;
}
边栏推荐
猜你喜欢

QML module not found

对需求的内容进行jieba分词并按词频排序输出excel文档

Google analyzes how UA can be transferred to the latest version of GA4

Xiaobai programmer the next day

Playwright tutorial (I) suitable for Xiaobai

TS:typora代码片段缩进显示异常(已解决)-2022.7.24

Perform Jieba word segmentation on the required content and output EXCEL documents according to word frequency

Redis foundation 2 (notes)

Xiaobai programmer's first day

Nuclear power plants strive to maintain safety in the heat wave sweeping Europe
随机推荐
To light up all the positions in the string that need to be lit, at least a few lights are needed
Visitor mode
3dslicer importing medical image data
6-18 vulnerability exploitation - backdoor connection
Perform Jieba word segmentation on the required content and output EXCEL documents according to word frequency
SMART S7-200 PLC通道自由映射功能块(DO_Map)
Xiaobai programmer's seventh day
D3.js learning
科大讯飞智能办公本Air电纸书阅读器,让我的工作生活更加健康
internship:普通常用的工具类编写
The third day of Xiaobai programmer
LabVIEW 开发 PCI-1680U双端口CAN卡
torchvision
数据库进阶·如何针对所有用户数据中没有的数据去加入随机的数据-蜻蜓Q系统用户没有头像如何加入头像数据-优雅草科技kir
Builder pattern
启牛商学院和微淼商学院哪个靠谱?老师推荐的开户安全吗?
Multi data source switching
Fill the whole square with the float property
【数据库学习】Redis 解析器&&单线程&&模型
Matrix of C language