码迷,mamicode.com
首页 >  
搜索关键字:大数乘法    ( 132个结果
高精度之乘法
题目描述 Description 给出两个正整数A和B,计算A*B的值。保证A和B的位数不超过500位。 输入描述 Input Description 读入两个用空格隔开的正整数 输出描述 Output Description 输出A*B的值 样例输入 Sample Input 3 12 样例输出 Sa...
分类:其他好文   时间:2015-03-10 13:59:13    阅读次数:135
大数乘法
题解:用字符数组存两个因数,再将数组逆序以便处理,再对每一个数位进行处理,注意字符类型与整型的变换,每一位相乘时需将每位上的字符减48,最后存计算结果时载加48,输出是需逆序输出。代码如下:#include#includeint main(){ char A[100],B[100],ch...
分类:其他好文   时间:2015-02-22 12:12:39    阅读次数:135
HDOJ-1042 N!(大数乘法)
http://acm.hdu.edu.cn/showproblem.php?pid=1042题意清晰..简单明了开门见山的大数乘法..10000的阶乘有35000多位 数组有36000够了# include # include # define MAX 36000int BigNum[MAX], N...
分类:其他好文   时间:2015-02-21 23:27:43    阅读次数:375
LeetCode --- 43. Multiply Strings
题目链接:Multiply Strings Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 这道题的要求是计算大数乘法。其中大数...
分类:其他好文   时间:2015-02-10 09:16:09    阅读次数:114
[LeetCode]43.Multiply Strings
【题目】 Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 【分析】 高精度乘法(大数乘法) 【代码】 /***...
分类:其他好文   时间:2015-01-28 13:02:52    阅读次数:165
【HDOJ】2424 Gary's Calculator
大数乘法加法,直接javaA了。 1 import java.util.Scanner; 2 import java.math.BigInteger; 3 4 public class Main { 5 public static void main(String[] args) { 6 ...
分类:其他好文   时间:2015-01-25 23:53:40    阅读次数:271
用分治法实现大数乘法,加法,减法(java实现)
大数乘法即多项式乘法问题,求A(x)与B(x)的乘积C(x),朴素解法的复杂度O(n^2),基本思想是把多项式A(x)与B(x)写成 A(x)=a*x^m+bB(x)=c*x^m+d其中a,b,c,d为x的多项式。则A(x)*B(x)=(ac)*x^2m+(ad+bc)*x^m+bd由ad+bc.....
分类:编程语言   时间:2015-01-09 10:41:20    阅读次数:171
UVA - 748 Exponentiation
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25197 给定一个浮点数a,求a的n次方的精确值,并且忽略前导0和后面多余的0. 用一个结构体保存浮点数a去掉小数点后的值,同时记录小数的位数,然后用大数乘法,来代替a的n次幂,求出精确值。 #include #include struct node { int ...
分类:其他好文   时间:2014-12-15 09:05:37    阅读次数:186
大数乘法
1、分治算法的核心思想,时间复杂度为 : :2、进位算法,时间复杂度为n的平方。
分类:其他好文   时间:2014-12-08 13:40:20    阅读次数:141
UVA 10106-Product(大数乘法)
Product Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Description  Product  The Problem The problem is to multiply two ...
分类:其他好文   时间:2014-12-08 09:21:46    阅读次数:201
132条   上一页 1 ... 10 11 12 13 14 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!