
算法模板
WeSeewe_Wy
这个作者很懒,什么都没留下…
展开
-
组合数
一、定义与性质1.定义2.性质C(n,m)=C(n,n-m)=C(n-1,m-1)+C(n-1,m)//组合数打表void Combination(){//求组合数 c[0][0]=1; for(int i=1;i<MAXN;i++){ c[i][0]=c[i][i]=1; for(int j=1;j<...原创 2018-03-29 00:22:52 · 196 阅读 · 0 评论 -
【板子】gcd、exgcd、乘法逆元、快速幂、快速乘、筛素数、快速求逆元、组合数
出处:https://www.cnblogs.com/flipped/p/5716603.html1.gcdint gcd(int a,int b){ return b?gcd(b,a%b):a;} 2.扩展gcd )extend great common divisorll exgcd(ll l,ll r,ll &x,ll &y){...转载 2018-08-29 18:26:05 · 352 阅读 · 0 评论