目录
- void get_div(int x)
- {
- vector<int>res;
- for(int i=1;i<=x/i;i++)
- if(x%i==0)
- {
- res.push_back(i);
- if(i!=x/i) res.push_back(x/i); //如果不是平方数 就把它配对的数也放进去
- }
- sort(res.begin(),res.end());
- for(auto t:res) cout<
' '; - puts("");
- }
- #include
- #include
- using namespace std;
-
- typedef long long LL;
- const int mod=1e9+7;
-
- int main()
- {
- unordered_map<int,int>primes;//存储所有的底数和指数
- int t;
- cin>>t;
- while(t--)
- {
- int x;
- cin>>x;
- for(int i=2;i<=x/i;i++)
- while(x%i==0)
- {
- x/=i;
- primes[i]++;
- }
- if(x>1) primes[x]++;
- }
- LL res=1;
- for(auto x:primes) res=res*(x.second+1)%mod;
- cout<
- return 0;
- }
三、871 约数之和

- #include
- #include
- using namespace std;
-
- typedef long long LL;
- const int mod=1e9+7;
-
- int main()
- {
- unordered_map<int,int>primes;//存储所有的底数和指数
- int t;
- cin>>t;
- while(t--)
- {
- int x;
- cin>>x;
- for(int i=2;i<=x/i;i++)
- while(x%i==0)
- {
- x/=i;
- primes[i]++;
- }
- if(x>1) primes[x]++;
- }
- LL res=1;
- for(auto x:primes)
- {
- LL a=x.first,b=x.second;
- LL t=1;
- while(b--) t=(t*a+1)%mod;
- res=res*t%mod;
- }
-
-
相关阅读:
一对多关系实现部门—>员工的查询
【Python系列】Python 方法变量参数详解
络达开发---串口日志&日志过滤
Aigtek高精度电流源仪器设计规范
【Bio】基础生物学 - 蛋白质 protein
【译】Silverlight 不会消亡 XAML for Blazor 到来
21、JavaScript学习笔记——try...catch
PRML学习笔记--似然函数到底是什么
Flutter笔记:序列化与反序列化
【LeetCode】two num·两数之和
-
原文地址:https://blog.csdn.net/weixin_61639349/article/details/126722890