卢卡斯定理
zzk_233
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
bzoj 1951 [Sdoi2010]古代猪文
这是一道数论集合题 求式子,首先可以先用欧拉定理将式子降幂为指数mod (999911659-1)。 而对于指数可以在根号n的时间内枚举每个约数,对于每个约数求相应的组合数,可以用lucas定理来求解, 但是因为这个模数不是指数,所以把这个模数拆开,再用中国剩余定理合并就好了 注意的点是当g等于999911659时,这个定理不适用,但显然答案是0,所以要特判掉。 #include&...原创 2018-10-28 14:26:01 · 211 阅读 · 0 评论 -
bzoj 2982: combination(lucas定理模板)
lucas定理板子 对于可以转化为这是一个递归的过程,时间为log。 #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; typedef long long ll; int n,m,p=10007; ll inv[...原创 2018-10-28 14:32:36 · 204 阅读 · 0 评论
分享