当前位置:网站首页>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];
边栏推荐
猜你喜欢

C语言 - 位段

Convolution, pooling, activation function, initialization, normalization, regularization, learning rate - Summary of deep learning foundation

How to use information mechanism to realize process mutual exclusion, process synchronization and precursor relationship

C language custom type: struct

NFT smart contract release, blind box, public offering technology practice -- contract

让学指针变得更简单(三)

Understanding of law of large numbers and central limit theorem

Golang DNS write casually

21. Delete data

Step by step guide to setting NFT as an ens profile Avatar
随机推荐
C language custom type: struct
Parameter self-tuning of relay feedback PID controller
二叉树创建 & 遍历
Learn Arduino with examples
Entity class design for calculating age based on birthday
【云原生】手把手教你搭建ferry开源工单系统
Webrtc series-h.264 estimated bit rate calculation
Data governance: metadata management
"Designer universe": "benefit dimension" APEC public welfare + 2022 the latest slogan and the new platform will be launched soon | Asia Pacific Financial Media
22. Empty the table
使用 BR 恢复 S3 兼容存储上的备份数据
指针和数组笔试题解析
Golang DNS 随便写写
NFT smart contract release, blind box, public offering technology practice -- contract
How to use information mechanism to realize process mutual exclusion, process synchronization and precursor relationship
Pyqt5 development tips - obtain Manhattan distance between coordinates
ROS learning (IX): referencing custom message types in header files
数据治理:主数据的3特征、4超越和3二八原则
Binary tree creation & traversal
Huawei cloud OBS file upload and download tool class