
逆元
Error Man
我是菜逼
展开
-
FZU - 2303 Mind control(组合数学 + 期望)
Mind controlThere is a wonderful country where people like eating very much. Each person has exactly one direct follower while the follower's follower is also follower of this man (of course the mos...原创 2018-08-26 20:50:38 · 811 阅读 · 0 评论 -
乘法逆元 求组合数取模 (模为质数)
为什么求组合数取模,可以用 乘法逆元来做。所以求 组合数取模 就是求 % mod.对于正整数和 p,如果有 ,那么把这个同余方程中的最小正整数解叫做 a 模 p 的逆元。即如果% p = 1, 那么x的最小正整数解就是 a 的逆元。可以得到 % M () % M; //费马小定理所以% M =(% M )% M.ty...转载 2018-08-14 00:21:56 · 704 阅读 · 0 评论 -
Codeforces 224E.Partial Sums(组合数学+费马小定理,重复 k 次前缀和)
E.Partial SumsYou've got an arraya, consisting ofnintegers. The array elements are indexed from 1 ton. Let's determine a two step operation like that:First we build by the arrayaan arrayso...原创 2019-08-03 20:09:40 · 434 阅读 · 0 评论 -
HDU 5976 Detachment (16 大连[铜],预处理 + 前缀积 + 费马小定理 + 贪心 + 二分)
DetachmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 4487 Accepted Submission(s): 1268Problem DescriptionIn a highly developed alien...原创 2019-09-15 21:11:10 · 207 阅读 · 0 评论