当前位置:网站首页>【集训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;
}
边栏推荐
- How to implement an app application to limit users' time use?
- 还不懂mock测试?一篇文章带你熟悉mock
- 【集训DAY15】简单计算【树状数组】【数学】
- Usage of in in SQL DQL query
- 对需求的内容进行jieba分词并按词频排序输出excel文档
- 数学规划分类 Math Programming Classfication
- Internship: writing common tool classes
- 『SignalR』. Net using signalr for real-time communication
- Flex layout
- synchronized与volatile
猜你喜欢

SMART S7-200 PLC通道自由映射功能块(DO_Map)

科大讯飞智能办公本Air电纸书阅读器,让我的工作生活更加健康

数据质量:数据治理的核心

Xiaobai programmer's sixth day

6-17 vulnerability exploitation - deserialization remote command execution vulnerability

Playwright tutorial (II) suitable for Xiaobai

3dslicer introduction and installation tutorial

完啦,上班三个月,变秃了

『SignalR』. Net using signalr for real-time communication

Smart S7-200 PLC channel free mapping function block (do_map)
随机推荐
What have I experienced to become a harder tester than development?
【PMP学习笔记】第1章 PMP体系引论
4day
Data quality: the core of data governance
【集训DAY15】Boring【树形DP】
Can I buy financial products with a revenue of more than 6% after opening an account
Fill the whole square with the float property
Xiaobai programmer's fourth day
Playwright tutorial (II) suitable for Xiaobai
Wechat applet (anti shake, throttling), which solves the problem that users keep pulling down refresh requests or clicking buttons to submit information; Get the list information and refresh the data
How many bytes does Boolean occupy?
Xiaobai programmer day 8
3dslicer introduction and installation tutorial
How to implement an app application to limit users' time use?
IFLYTEK smart office book air e-book reader makes my work life healthier
TS:typora代码片段缩进显示异常(已解决)-2022.7.24
Google analyzes how UA can be transferred to the latest version of GA4
Pyspark data analysis basis: pyspark.sql.sparksession class method explanation and operation + code display
Common source code for ArcGIS development
C语言逆序打印字符串的两种方法