当前位置:网站首页>【集训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;
}
边栏推荐
- 编译和反编译
- On the difference between break and continue statements
- ML-Numpy
- 完啦,上班三个月,变秃了
- MapGIS格式转ArcGIS方法
- If it is modified according to the name of the framework module
- What is partition and barrel division?
- 数据库进阶·如何针对所有用户数据中没有的数据去加入随机的数据-蜻蜓Q系统用户没有头像如何加入头像数据-优雅草科技kir
- 分割金条的代价
- Wechat applet application development competition works comprehensive development record - Jinlu cultural tourism (cloud development - Overview)
猜你喜欢

Method of converting MAPGIS format to ArcGIS

Victoriametrics single node of kubernetes

还不懂mock测试?一篇文章带你熟悉mock

SQL中in的用法 DQL 查询

MySQL - subquery - column subquery (multi row subquery)

How to resolve a domain name to multiple IP addresses?

如何将一个域名解析到多个IP地址?

Interpretation of the source code of all logging systems in XXL job (line by line source code interpretation)

Selenium basic use and use selenium to capture the recruitment information of a website (continuously updating)

4day
随机推荐
xss-工具-Beef-Xss安装以及使用
scrapy无缝对接布隆过滤器
QML module not found
Xiaobai programmer's fifth day
6-17 vulnerability exploitation - deserialization remote command execution vulnerability
Title: give a group of arrays, arranged from large to small and from small to large.
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No suc
JS interview questions
TS:typora代码片段缩进显示异常(已解决)-2022.7.24
Xiaobai programmer's fourth day
arcgis开发常用源码
Internship: writing common tool classes
VIM usage record
Usage of in in SQL DQL query
英文术语对应的解释
Minor GC 和 Full GC 有什么不同呢?
Which is reliable between qiniu business school and WeiMiao business school? Is it safe to open an account recommended by the teacher?
沃达德软件:智慧城市方案
【集训DAY15】简单计算【树状数组】【数学】
ThreadLocal summary (to be continued)