当前位置:网站首页>阶乘约数(唯一分解定理)
阶乘约数(唯一分解定理)
2022-07-01 06:06:00 【大 聪 明】
题目描述
定义阶乘 n! = 1 × 2 × 3 × · · · × n。
请问 100!(100 的阶乘)有多少个正约数。
分析:正约数也就是正因数,把阶乘分开求,用到了乘法分配律;需要结合本博客相关知识
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[110];
int main()
{
for(int i=1;i<=100;i++)
{
int tmp=i;
for(int j=2;j<=tmp;j++)//从2开始
{
while(tmp%j==0)//非质数都成倍数关系 所以后边就没了
{
a[j]++;
tmp/=j;
}
}
}
ll ans=1;
for(int i=1;i<=100;i++)
{
if(a[i])
ans*=(1+a[i]);
}
cout<<ans<<endl;
}
边栏推荐
- Record currency in MySQL
- FPGA - 7系列 FPGA内部结构之Clocking -02- 时钟布线资源
- Save data in browser to local file
- Cjc8988 Low Power Stereo codec with 2 stereo headphone drivers
- Know the future of "edge computing" from the Nobel prize!
- Using Baidu map to query national subway lines
- 68 Cesium代码datasource加载czml
- Small guide for rapid completion of mechanical arm (VI): stepping motor driver
- c# Xml帮助类
- π disk, turning your computer into a personal private cloud
猜你喜欢

从诺奖知“边缘计算”的未来!

Leetcode Max rectangle, Max square series 84 85. 221. 1277. 1725. (monotonic stack, dynamic programming)

穿越派 你的数据云行

Crossing sect · paipan + Siyuan notes = private notebook

excel動態圖錶

Crossing pie · pie pan + Mountain duck = local data management

68 cesium code datasource loading czml

让田头村变甜头村的特色农产品是仙景芋还是白菜

What if the data in the cloud disk is harmonious?

Transformer le village de tiantou en un village de betteraves sucrières
随机推荐
The row and column numbers of each pixel of multi-source grid data in the same area are the same, that is, the number of rows and columns are the same, and the pixel size is the same
3D打印机穿线:5种简单的解决方案
FPGA - 7系列 FPGA内部结构之Clocking -01- 时钟架构概述
DEV XPO对比之XAF BO
讓田頭村變甜頭村的特色農產品是仙景芋還是白菜
2022 the 8th China International "Internet +" college student innovation and entrepreneurship competition industry proposition track is open for registration!
穿越派·派盘 + 思源笔记 = 私人笔记本
SystemVerilog学习-09-进程间同步、通信和虚方法
OpenGL ES: (5) OpenGL的基本概念、OpenGL ES 在屏幕产生图片的过程、OpenGL管线(pipeline)
How to add a gourd pie plate
利用百度地图查询全国地铁线路
restframework-simpleJWT重写认证机制
论文学习记录随笔 多标签之LIFT
MySQL里记录货币
Fixed height of the first column in El table dynamic header rendering
excel動態圖錶
TiDB单机模拟部署生产环境集群(闭坑实践,亲测有效)
云盘里资料被和谐了,怎么办?
Crossing sect · paipan + Siyuan notes = private notebook
One of the characteristic agricultural products that make Tiantou village, Guankou Town, Xiamen into a "sweet" village is