Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:为什么啊??In Reply To:为什么啊?? Posted by:zjut020 at 2009-02-27 19:27:25 n! / (k! (n - k)!) 判断分子和分母的2的阶数大小即可 而且计算N!中2的阶数,只要计算N/2+N/4…… 但如果用N/2+N/4……,这样的效率还是很低,用移位操作比较好 与 while(n=n>>1) a+=n; while(m=m>>1) b+=m; while(k=k>>1) c+=k; 等价的, 我也从这题中学到很多,呵呵,共同进步... Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator