acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 题解

    #include<iostream> #include<vector> #include<map> using namespace std; typedef long long ll; ll factorial(int n){ ll res=1; for(int i=2;i<=n;i++){ res*=i; } return res; } int main(){ int x; while(cin>>x){ map<int,int>factors; int temp=x; for(int i=2;i*i<=temp;i++){ while(temp%i==0){ factors[i]; temp/=i; } } if(temp>1){ factors[temp]; } int total_exp=0; for(auto&factor:factors){ total_exp+=factor.second; } ll count=factorial(total_exp); for(auto&factor:factors){ count/=factorial(factor.second); } cout<<total_exp<<" "<<count<<endl; } return 0; }

    userId_undefined
    用毒毒毒蛇,毒蛇会被毒毒死吗
    进制转换师造物者素数猎手俄罗斯套娃大师倔强青铜递归·套娃学徒
    0阅读
    0回复
    0点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页