当前位置:网站首页>Permutation and combination function

Permutation and combination function

2022-07-06 08:11:00 . dye

array

ll A(ll n,ll m) 
{ ll co=1; if(m==0){return co;} 
  for(ll i=m+1;i<=n;i++){
  	co*=i;
  }
   return co;
}

Combine

ll C[100][100];
void C(int n)// ceiling  
{
    for(int i = 0; i <n+1; ++i) {
        for(int j = 0; j <= i; ++j) {
            if(!j) C[i][j] = 1;
            else C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % ((ll)(1e9 + 7));
        }
    }
}

After entering the upper limit

Usage method 15 Choose from 6 individual Namely C[15][6];

原网站

版权声明
本文为[. dye]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131839401343.html