博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 1402 A * B Problem Plus(FFT)
阅读量:4509 次
发布时间:2019-06-08

本文共 792 字,大约阅读时间需要 2 分钟。

题目链接:

题意:

让你求两个大数的乘法。

题解:

FFT裸题。

FFT学习推荐:

1 #include
2 #define F(i,a,b) for(int i=a;i<=b;++i) 3 using namespace std; 4 5 const double pi=acos(-1.0); 6 //n 必须为 2 的幂。 7 struct comp{ 8 double r,i; 9 comp(double _r=0,double _i=0){r=_r,i=_i;}10 comp operator+(const comp x){
return comp(r+x.r,i+x.i);}11 comp operator-(const comp x){
return comp(r-x.r,i-x.i);}12 comp operator*(const comp x){
return comp(r*x.r-i*x.i,r*x.i+i*x.r);}13 };14 15 void FFT(comp a[],int n,int t){16 for(int i=1,j=0;i
>=1,~j&s;);19 if(i
0)n--;72 for(int i=n;i>=0;i--)printf("%c",sum[i]+'0');73 puts("");74 }75 return 0;76 }
View Code

 

转载于:https://www.cnblogs.com/bin-gege/p/6601247.html

你可能感兴趣的文章
原码、反码、补码和移码
查看>>
SQL存储过程与函数的区别
查看>>
@Resource和@Autowired区别
查看>>
VS2010打开就自动关闭问题解决
查看>>
持续部署之jenkins与gitlab(三)
查看>>
第二章 Jenkins安装与配置
查看>>
POJ 3169 Layout 差分约束系统
查看>>
IOS 缩放图片常用方法
查看>>
软件工程课
查看>>
Pycharm-连接服务器
查看>>
[Leetcode] The Skyline Problem
查看>>
okhttp异步请求流程和源码分析
查看>>
【集合框架】JDK1.8源码分析之Comparable && Comparator(九)
查看>>
Flutter之内置动画(转)
查看>>
uni-app中onLoad不起作用
查看>>
多线程概述
查看>>
Linux_ubuntu命令-用户、权限管理
查看>>
Knowladge_网站学习_RSS 学习
查看>>
TCP/IP,Web世界的基本规则
查看>>
c++ 子类构造函数初始化及父类构造初始化
查看>>