当前位置:网站首页>阶乘约数(唯一分解定理)
阶乘约数(唯一分解定理)
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;
}
边栏推荐
猜你喜欢

Crossing sect · paipan + Siyuan notes = private notebook

Ant new village is one of the special agricultural products that make Tiantou village in Guankou Town, Xiamen become Tiantou village

相同区域 多源栅格数据 各个像元行列号一致,即行数列数相同,像元大小相同

He struggled day and night to protect his data

论文学习记录随笔 多标签之LSML

LED lighting used in health lighting

让厦门灌口镇田头村变“甜头”村的特色农产品之一是

excel動態圖錶

蚂蚁新村田头村变甜头村 让厦门灌口镇田头村变甜头村的特色农产品之一是

分布式锁实现
随机推荐
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
Crossing sect · paipan + Siyuan notes = private notebook
2022 the 8th China International "Internet +" college student innovation and entrepreneurship competition industry proposition track is open for registration!
解决麒麟V10上传文件乱码问题
DHT11 temperature and humidity sensor
C XML help class
excel动态图表
C language beginner level - realize the minesweeping game
关于一道01背包问题的·拓展题的思考
指数法和Random Forest实现山东省丰水期地表水体信息
He struggled day and night to protect his data
How does MySQL store Emoji?
表格中el-tooltip 实现换行展示
PLA不粘贴在床上:6个简单的解决方案
【文件系统】如何在ubi之上运行squashfs
OpenGL es: (4) detailed explanation of EGL API (Continued)
OpenGL es: (5) basic concepts of OpenGL, the process of OpenGL es generating pictures on the screen, and OpenGL pipeline
c# Xml帮助类
Database problems, how to optimize Oracle SQL query statements faster and more efficient
2022 年面向初学者的 10 大免费 3D 建模软件