摘要: Lucas定理是用来求 C(n,m) mod p,p为素数的值。(注意:p一定是素数) 给出组合数C(n,m), 表示从n个元素中选出m个元素的方案数。例如C(5,2) = 10, C(4,2) = 6.可是当n,m比较大的时候,C(n,m)很大!于是xiaobo希望你输出 C(n,m) mod p 阅读全文
posted @ 2019-08-14 21:31 weilong13 阅读(185) 评论(0) 推荐(0)
摘要: 知识点: 调和级数(即f(n))至今没有一个完全正确的公式,但欧拉给出过一个近似公式:(n很大时) f(n)≈ln(n)+C+1/2*n 欧拉常数值:C≈0.57721566490153286060651209 In mathematics, the nth harmonic number is t 阅读全文
posted @ 2019-08-13 20:25 weilong13 阅读(3833) 评论(0) 推荐(0)
摘要: 用位图进行素数筛,节省空间。 阅读全文
posted @ 2019-08-13 20:22 weilong13 阅读(309) 评论(0) 推荐(0)
摘要: Give a tree with n vertices,each edge has a length(positive integer less than 1001).Define dist(u,v)=The min distance between node u and v. Give an in 阅读全文
posted @ 2019-08-05 21:34 weilong13 阅读(164) 评论(0) 推荐(0)
摘要: Loppinha loves to go to the gym with his friends. He takes his training sessions very seriously, and he always follows his schedule very strictly. He 阅读全文
posted @ 2019-08-05 19:55 weilong13 阅读(248) 评论(0) 推荐(0)