Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:前者用分制,比较简单;后者用傅立叶变换

Posted by daizisheng at 2003-10-18 20:08:49 on Problem 1405
In Reply To:前者用分制,比较简单;后者用傅立叶变换 Posted by:hawk at 2003-10-18 10:48:57
不至于把
比赛的时候因为我的高精度程序有问题才这样的
后来修改了一下
很容易就过了阿


> 具体资料网上有,自己查一下看:)
> 下面简略说一下分制,估计大多数都也都知道的:
> 用分制比如就把乘数分为两部分(可以按照高位,低位分也可以按照奇数位偶数位分)
> 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator