
组合数
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 评论 -
Gerald and Giant Chess (CodeForces - 560E)(组合数)
Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we’ll just say that the game takes place on an h × w field, and it is painted in two colors, but not like in ches原创 2017-06-05 21:26:31 · 534 阅读 · 0 评论 -
Color UVALive - 7040 (容斥+组合数)
Recently, Mr. Big recieved n owers from his fans. He wants to recolor those owers with m colors. The owers are put in a line. It is not allowed to color any adjacent owers with the same color. Flowers原创 2017-10-24 23:38:25 · 338 阅读 · 0 评论 -
1137 计算系数(组合数)
给定一个多项式(ax + by)^k,请求出多项式展开后x^n y^m项的系数。输入描述 Input Description 共一行,包含 5 个整数,分别为a,b,k,n,m,每两个整数之间用一个空格隔开。输出描述 Output Description 输出共 1 行,包含一个整数,表示所求的系数,这个系数可能很大,输出对10007 取模后的结果。样例输入 Sample Inpu...原创 2018-03-21 20:39:00 · 3338 阅读 · 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 评论