当前位置:网站首页>模板_计算组合数
模板_计算组合数
2022-06-10 16:42:00 【这题AC再睡.】
//
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL C( LL n,LL m )
{
if( n<m ) return 0;
if( n==m || m==0 ) return 1;
LL ans,i; n=n-m+1;
for( ans=i=1;i<=m;i++ )
{
ans*=n++; ans/=i; // 防溢出
}
return ans;
}
int main()
{
LL n,m;
while( cin>>n>>m )
{
cout<<C( n,m )<<endl;
}
return 0;
}边栏推荐
猜你喜欢

消除业务代码中if....else的五种方式

Nacos配置管理

Nacos注册中心

com.netflix.client.ClientException: Load balancer does not have available server for client: userser

Web3 is the most complete money making secret script. Just read this one

What should be done to improve the service level of the park and optimize the business environment

2022年焊工(初级)试题模拟考试平台操作

运筹说 第64期丨动态规划奠基人——理查德·贝尔曼

Xinsi technology helps Israel visuality systems promote the "left shift" of security

Only three steps are needed to learn how to use low code thingjs to connect with Sen data Dix data
随机推荐
Internet enterprises and chips
【内容共创】第17期 夏日炎炎,有你超甜!参与签约华为云小编,花样礼包总有一款打动你!
KDD 2021 | MoCL:利用多层次领域知识的分子图对比学习
Facebook AI | learning reverse folding from millions of prediction structures
Importerror: libgl. so. 1: cannot open shared object file: no such file or directory
Knowledge-based BERT: 像计算化学家一样提取分子特征的方法
Richard Behrman, the founder of dynamic planning
This article introduces you to j.u.c's futuretask, fork/join framework and BlockingQueue
AIChE | 集成数学规划方法和深度学习模型的从头药物设计框架
Example analysis of SQL injection error reporting
使用KuboardSpray安装kubernetes(v1.23.1)
亟需丰富智能家居产品线,扫地机器人赛道上挤得下萤石吗?
路由器实验之serial接口的静态路由配置(补充)
华为matepad能成为你的笔记本电脑副屏?
【抬杠C#】如何实现接口的base调用
期货账户资金安全吗?
Web3 is the most complete money making secret script. Just read this one
Redis operation set, Zset, hash data types and use of visualization tools
自定义视图:图形与图像的处理(一):使用简单图片
ADB is not an internal or external command, nor is it a runnable program or batch file