https://atcoder.jp/contests/abc110/tasks/abc110_d

#include 
using namespace std;
#define int long long
int n,m;
//int b[250005],a[250005],c[250005],d[250005];
vector<int>v;
set<int>s;
int ans=1, cnt, M=1e9+7, c[100050][35]={1};
signed main()
{
	cin>>n>>m;
	for(int i=1;i<=n+30;i++)
	{
		c[i][0]=1;
		for(int j=1;j<=min(i,30ll);j++)
		{
			c[i][j]=(c[i-1][j-1]+c[i-1][j])%M;
		}
	}
	int t=m;
	for(int i=2;i*i<=m;i++)
	{
		cnt=0;
		while(t%i==0)t/=i,cnt++;
		if(cnt>0)ans=ans*c[cnt+n-1][cnt]%M;
	}
	if(t!=1)ans=ans*n%M;
	cout<<ans<<'\n';
	
	
	
	
	
	
	
}
/*	
		int i, j, t;
		cin>>n>>m;
		for(i=1; i<=n+30; i++) {
			C[i][0] = 1;
			for(j=1; j<=min(i,30ll); j++) 
				C[i][j] = (C[i-1][j-1] + C[i-1][j]) % M;
		}
		for(int i=n+30;i>=1;i--)
		{
			for(int j=0;j<=min(i,30ll);j++)
				cout<0) ans = (ans * C[cnt+n-1][cnt]) % M;
		}
		if(t>1) ans = (ans * n) % M;
		cout<	

这题不会

你可能感兴趣的:(gaogesing的聪明题,算法,c++,数据结构)