HDU1402:A * B Problem Plus——题解】的更多相关文章

http://acm.hdu.edu.cn/showproblem.php?pid=1402 给出两个高精度正整数,求它们的积,最长的数长度不大于5e4. FFT裸题,将每个数位看做是多项式的系数即可. 我们最后就是要求出两个多项式相乘的系数. #include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namesp…
https://www.lydsy.com/JudgeOnline/problem.php?id=2298 https://www.luogu.org/problemnew/show/P2519 一次考试共有n个人参加,第i个人说:“有ai个人分数比我高,bi个人分数比我低.”问最少有几个人没有说真话(可能有相同的分数) 好题啊,以及我的dp为什么这么烂……算了吐槽放后面. 参考洛谷题解. 显然a+b+1>n一定是谎话,直接特判. 然后考虑冲突,显然两人名次相同的情况下a和b不同就说明这两人只能…
@(学习笔记)[FFT, NTT] Problem Description Calculate A * B. Input Each line will contain two integers A and B. Process to end of file. Note: the length of each integer will not exceed 50000. Output For each case, output A * B in one line. Sample Input 1 2…
[比赛链接] 点击打开链接 [题解] Problem A Word Correction[字符串] 不用多说了吧,字符串的基本操作 Problem B  Run for your prize[贪心] 我们可以将这个数轴一分为二,小于等于500000的由第一个人领,否则由第二个人领 Problem C Constructing tests[贪心][数学] 首先我们发现 : N^2 - (N / M)^2 = x (N/M向下取整) 然后我们算出N的上下界,发现: sqrt(x+1)<=N<=sq…
A * B Problem Plus Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12665    Accepted Submission(s): 2248 Problem Description Calculate A * B.   Input Each line will contain two integers A and B.…
洛谷P1919 [模板]A*B Problem升级版(FFT快速傅里叶) 刚学了FFT,我们来刷一道模板题. 题目描述 给定两个长度为 n 的两个十进制数,求它们的乘积. n<=100000 如果用 n^2 暴力,肯定会 TLE. 我们把这两个数看成一个多项式. f(x)=a0+a1*101+a2*102+a3*103+ ...... +an*10n 然后就可以愉快的FFT求解了!! #include<iostream> #include<cmath> #include<…
[题目描述] Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Comparison of a nut to another nut or a bolt to another bolt is not allowed. It means nut can only be compared with bol…
Problem Description Many geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. According to the experience of many ACMers, geometry problems are always much trouble, but this problem is ve…
http://www.lydsy.com/JudgeOnline/problem.php?id=2301 https://www.luogu.org/problemnew/show/P2522 对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公约数. (哇做完上面那道题之后看所有的莫比乌斯反演都好亲切啊) 这题应该是可以采用选数的方法(然而我翻车太厉害了就不写了) 那么我们思考容斥,就一个简单的二维容斥,…
本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/转载请注明出处,侵权必究,保留最终解释权! 题目链接:HDU1402 正解:FFT 解题报告: FFT模板题,注意一下进位处理. 重要的话说三遍:去掉多余的0!!!WA了几遍… //It is made by ljh2000 #include <iostream> #include <cst…