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 |
前者用分制,比较简单;后者用傅立叶变换In Reply To:老大讲解一下吧:) Posted by:gz2001 at 2003-10-18 10:38:08 具体资料网上有,自己查一下看:) 下面简略说一下分制,估计大多数都也都知道的: 用分制比如就把乘数分为两部分(可以按照高位,低位分也可以按照奇数位偶数位分) X=A*2^k+B;Y=C*2^k+D 然后有X*Y=A*B*2^(2k)+(A*D+B*C)*2^k+C*D; 这里只要计算3次n/2(设原来的X和Y都是n位的)乘法 K1=A*B; K2=C*D; K3=(A+B)*(C+D)-K1-K2=A*D+B*C; 时间复杂度就是T(n)=3T(n/2)+O(n); 就是n^lg3的复杂度 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator