String
Problem Description
Recently, lxhgww received a task : to generate strings contain '0's and '1's only, in which '0' appears exactly m times, '1' appears exactly n times. Also, any prefix ...
分类:
其他好文 时间:
2014-11-11 21:10:17
阅读次数:
520
1.利用整数唯一分解定理,求(n+1-m) * (n+m)! / ( m! * (n+1)! )
任何正整数都有且只有一种方法写出其素因子幂相乘的形式。比如18= 2 * 3^2
A=(p1^k1)*(p2^k2)*(p3^k3)*(p4^k4)*......*(pn^kn) pi为素数
还有把阶层看作一个数,比m! 怎样求m!里面素数2的指数呢?
cnt=0; while(...
分类:
其他好文 时间:
2014-11-11 21:09:39
阅读次数:
198