考虑组合数(C_{m}^{n})
其实他们的方案数就是杨辉三角
此时有一个递推式
c[i][j]=c[i-1][j]+c[i-1][j];
#include<bits/stdc++.h>
using namespace std;
const int N=1000;
const int mod=1e9+7;
const int maxn=2010;
int c[maxn][maxn];
int a,b;
void init()
{
for(int i=0;i<=N;i++)
{
for(int j=0;j<=i;j++)
{
if(j==0)
c[i][j]=1;
else c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
}
}
}
int main()
{
init();
int t;
for(int i=0;i<=15;i++)
{
puts(" ");
for(int j=0;j<=i;j++)
cout<<c[i][j]<<" ";
}
return 0;
}