摘要: https://www.xuebuyuan.com/2867209.html 求组合数C(n,m)(modp) C(n,m)=n!/(m!*(n-m)!) ,只要对分子和分母分别分解素因子,然后因为C(n,m)肯定是整数,所以C(n,m)肯定可以表示成p1^t1*p2^t2*......pi^ti的 阅读全文
posted @ 2018-09-28 20:31 过路人1998 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 这是一个优秀的大数板子.. 阅读全文
posted @ 2018-09-27 16:38 过路人1998 阅读(378) 评论(0) 推荐(0) 编辑
摘要: D - Bomb HDU - 3555 The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence o 阅读全文
posted @ 2018-09-23 22:34 过路人1998 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 不知道原理.. 听说扔一定的前n项,然后就可以得到答案了. 阅读全文
posted @ 2018-09-17 14:56 过路人1998 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/acm/contest/190/A来源:牛客网 A. 做水题就是在浪费时间,但是一场比赛要是没有送分的签到题,大家的比赛体验就会很差。为了优化你的比赛体验又不浪费你的读题时间,我并不打算给你很复杂的故事背景,你只需要复制下面的代码并选择正确的语 阅读全文
posted @ 2018-09-16 22:08 过路人1998 阅读(1027) 评论(0) 推荐(0) 编辑
摘要: 查询还是没有get到点. 可以求第K小. (中位数问题 <--> 第K小) 阅读全文
posted @ 2018-09-16 19:08 过路人1998 阅读(126) 评论(0) 推荐(0) 编辑
摘要: // 洛谷: https://www.luogu.org/problemnew/show/P3919 数组 阅读全文
posted @ 2018-09-14 16:40 过路人1998 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 求从1...n的素数: 埃氏筛, 快速线性筛. 埃氏筛 快速线性筛:(近似线性) 阅读全文
posted @ 2018-09-12 10:53 过路人1998 阅读(140) 评论(0) 推荐(0) 编辑
摘要: ai...an中两两相乘. (这个式子可以用线段树 2个lazy来维护. 一个维护 sigam(ai) 一个维护 2*b*sigam(ai)+size*b*b 后者要先更新.因为用到了sigam(ai)) 式子来源: https://www.nowcoder.com/acm/contest/180/ 阅读全文
posted @ 2018-09-10 14:50 过路人1998 阅读(120) 评论(0) 推荐(0) 编辑
摘要: class Base { static const int max_bit = 32; // 注意 使用的时候要减一 int base[max_bit]; public : void init() { memset(base, 0, sizeof(base)); } void insert(int val) { ... 阅读全文
posted @ 2018-09-09 20:36 过路人1998 阅读(99) 评论(0) 推荐(0) 编辑