逆元
Eiffel灬
这个作者很懒,什么都没留下…
展开
-
HDU3240 Counting Binary Trees (卡特兰数,拓欧求逆元)
Counting Binary Trees HDU - 3240There are 5 distinct binary trees of 3 nodes: Let T(n) be the number of distinct non-empty binary trees of no more than nnodes, your task is to calcu原创 2017-07-26 21:11:22 · 558 阅读 · 0 评论 -
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 · 502 阅读 · 0 评论 -
zoj 3688 The Review Plan II(容斥原理+禁位排列+逆元)
The Review Plan IIMichael is very grateful for your last help of his review plan. Now he finds that it's interesting to do the review in a different way than ordinary students, he wants yo原创 2017-08-18 14:15:09 · 403 阅读 · 0 评论 -
递推求逆元,求组合数
求逆元有许多种方法,一般求单个数的逆元可以用拓展欧几里得或者费马小定理,在这里提供一种用递推关系求逆元的方法,时间复杂度是O(n),一般用于需要初始化逆元表的题目。/******递推求逆元一条龙********/ll get_inv(ll n) { if (n == 1) return 1; return get_inv(mod%n)*(mod - mod / n)原创 2017-08-23 15:15:35 · 425 阅读 · 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 · 428 阅读 · 0 评论