
Lucas定理
coldfresh
那我们开始吧
展开
-
关于求组合数的一些总结
对于求C(n,m) 1.如果是对于小范围内的n和m(不是很难)就不说了 差不多用java的大数就可以了 2.当n在1e10^5范围左右,往往是会有取模,设这个数为mod(往往mod为质数,这个很重要)。 既然是组合数,就免不了有阶乘的部分, n 的范围在10^5的数量级,所以完全可以线性扫一遍,用一个fac数组存i的阶乘对mod取模即可, 但是对于除法取模,必须得用到逆元,所以还是需要去原创 2017-06-05 20:49:16 · 1955 阅读 · 0 评论 -
Unknown Treasure HDU - 5446 (Lucas定理+CRT)
On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. Somewhere deep in the cave, she foun原创 2017-09-21 16:49:37 · 325 阅读 · 0 评论 -
【ZOJ - 2116】Christopher's Christmas Letter(Lucas)
Dashing thro’ the snow, In a one-horse open sleigh, O’er the fields we go, Laughing all the way; Bells on bobtail ring, Making spirits bright; What fun it is to ride and sing A sleighing song t...原创 2018-08-24 14:19:56 · 237 阅读 · 0 评论