#include <stdio.h>
typedef long long LL;
LL res[67][67]={0};
LL cal(LL m,LL n)
{//计算组合数
if(m==n||m==0)return 1;
else if(res[m][n]!=0)return res[m][n];
return res[m][n]=cal(m-1,n-1)+cal(m,n-1);//递归,先进行运算再返回res[m][n]
}
#include <stdio.h>
int res[1010][1010]={0};
int cal2(int m,int n,int p)
{
if(m==0||m==n)return 1;
if(res[m][n]!=0)return res[m][n];
res[m][n]=(cal(m-1,n-1,p)+cal(m,n-1,p))%p;//递归
return res[m][n];
}