Lucas定理
Eiffel灬
这个作者很懒,什么都没留下…
展开
-
LightOJ - 1067 Combinations
Combinations Given n different objects, you want to take k of them. How many ways to can do it?For example, say there are 4 items; you want to take 2 of them. So, you can do it 6 ways.Take 1,原创 2017-07-05 23:48:19 · 479 阅读 · 0 评论 -
Lucas定理模板
Lucas定理是用来求解C(m,n)mod p的值的。其中m和n的值可以很大,p一定是素数。对阶乘打表的模板LL quick_mod(LL a, LL b, LL c)//费马小定理+快速幂求逆元 { LL ans = 1; while (b) { if (b%2==1) ans = (ans*a) %原创 2017-09-06 18:59:47 · 359 阅读 · 0 评论 -
codeforces 451E Devu and Flowers(容斥原理,Lucas,dfs,隔板法)
E. Devu and Flowerstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDevu wants to decorate his garden with原创 2017-09-06 19:46:19 · 410 阅读 · 0 评论