当前位置:网站首页>Mathematical knowledge: sum of divisors - divisors
Mathematical knowledge: sum of divisors - divisors
2022-06-22 00:15:00 【Fight! Sao Nian!】
subject :AcWing 871. The sum of the approximations
Given n A positive integer ai, Please output the sum of divisors of the product of these numbers , The answer is right 109+7 modulus .
Input format
The first line contains integers n.
Next n That's ok , Each line contains an integer ai.
Output format
Output an integer , Represents the sum of divisors of the product of a given positive integer , The answer needs to be right 109+7 modulus .
Data range
1≤n≤100,
1≤ai≤2×109
sample input :
3
2
6
8
sample output :
252
Topic analysis :
If N=p1a1∗p2a2∗…∗pkak
Then sum of divisors : (p10+p11+…+p1a1)∗…∗(pk0+pk1+…+pkak)
If you find all of the p And The following code :while (b -- ) t = (t * a + 1) % mod;
t=t∗p+1
t=1
t=p+1
t=p2+p+1
……
t=pb+pb−1+…+1
#include <iostream>
#include <unordered_map>
using namespace std;
const int mod = 1e9+7;
int main()
{
unordered_map<int,int> primes;
int n;
cin>>n;
while(n--)
{
int a;
cin>>a;
for(int i=2;i<=a/i;i++)
{
while(a%i==0)
{
primes[i]++;
a/=i;
}
}
if(a>1)primes[a]++;
}
long long res=1;
for(auto it:primes)
{
long long mid = 1;
int p=it.first,b=it.second;
while(b--)mid=(mid*p+1)%mod;
res=res*mid%mod;
}
cout<<res<<endl;
return 0;
}
边栏推荐
- AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘
- 可省近90%服务器,反欺诈效率却大增,PayPal打破「AI内存墙」的方案为何如此划算?
- How to modify the judgment time of the equipment in the offline state when the national standard equipment is registered on the easycvr platform?
- 6月編程語言排行榜已出,這門語言要“封神”
- Nearly 90% of servers can be saved, but the anti fraud efficiency has greatly increased. Why is PayPal's plan to break the "Ai memory wall" so cost-effective?
- CVPR2022 | 弱监督多标签分类中的损失问题
- 二叉排序树
- buuctf misc zip
- buuctf misc 小易的U盘
- 洞見數據價值,啟迪數字未來,《數字化的力量》問世
猜你喜欢

Redis master-slave replication (9)

Xiuno Shura light forum imitation Zhihu blue simple responsive theme template 1.7+ adaptive pc+wap terminal

Nearly 90% of servers can be saved, but the anti fraud efficiency has greatly increased. Why is PayPal's plan to break the "Ai memory wall" so cost-effective?

Flag bit generation

buuctf misc 小易的U盘

学生管理系统实验报告-asp.net程序设计

Must the database primary key be self incremented? What scenarios do not suggest self augmentation?

How to modify the judgment time of the equipment in the offline state when the national standard equipment is registered on the easycvr platform?

Buuctf misc Xiaoyi USB flash disk

WMS warehouse management system source code
随机推荐
微博关闭发布多个兼职诈骗信息违规账号:如何打击数据造假灰产
【愚公系列】2022年06月 通用职责分配原则(九)-受保护变量原则
Win11 hotspot connection successful but no network? Solution of win11 mobile hotspot and network conflict
【golang】Cannot convert expression of type ‘interface{}‘ to type ‘string‘(解决方案)
【next】nextjs打包后出现passHref is missing
标志位生成
anaconda历史版本下载
[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
Oracle flashback and RMAN samples
Is Oriental Fortune futures regular? Is this platform safe and reliable?
IDA静态逆向分析工具使用详解
Katalon framework test web (VIII) wait
CVPR2022 | 弱监督多标签分类中的损失问题
buuctf misc zip
Reprint: network loading framework - retrofit
数学知识:约数之和—约数
[Yugong series] general responsibility allocation principle in June 2022 (IX) - principle of protected variables
可省近90%服务器,反欺诈效率却大增,PayPal打破「AI内存墙」的方案为何如此划算?
pytorch 界面编程相关
Component value transfer: props are used for parent component and child component value transfer