码迷,mamicode.com
首页 >  
搜索关键字:大数相乘 大数相加    ( 234个结果
LeetCode的medium题集合(C++实现)六
1 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-05-17 16:50:18    阅读次数:159
杭电1002(大数相加)
第一道大数,做这个题要细心,,#include#includeint main(){ int m,n; scanf("%d",&n); m=1; while(n--) { int i,j,k,t; char a[1001],b[1001]...
分类:其他好文   时间:2015-05-14 16:18:37    阅读次数:156
快速傅里叶变换FFT
看到两篇讲FFT算法的文章,觉得挺好,虽然还是不懂,说不定以后某一天就懂了呢...http://sgeteternal.iteye.com/blog/1136778http://www.cnblogs.com/Lyush/articles/3219196.htmlhdu1402的大数相乘就可以用到F...
分类:其他好文   时间:2015-05-09 14:45:04    阅读次数:103
大数加法
思路: 把两个加数各个数位上的数字相加,把相加结果的个位数字储存到第三个变量中去,而把十位数字提取出来参与下一次加法运算。 12345 +1247 用上图表示即先做 5+7=12,把12 的2放到一个第三个变量中,然后十位数字(进位)1则暂时储存起来,当做4+4=8的时候再把1加进来即=9。不断循环之后可得到两个大数相加的结果。 程序的实现: 考虑到是意两个长正整数,所以选用字...
分类:其他好文   时间:2015-05-09 10:21:43    阅读次数:142
uva 1592
一开始写的是这样: 用了书上写的ID函数,然后存二元组使用的大数相乘的方法,因为看错题目BIG一开始定义为10010,错了好几次找了半天错误=.= 后来发现存二元组也可以用make_pair(x,y)#include #include #include #include #include #define B...
分类:其他好文   时间:2015-05-03 16:04:37    阅读次数:99
模板 高精度计算
【模板】高精度计算大数相加: 1 #include 2 #include 3 #include 4 5 void add(char a[],char b[],char back[]) 6 { 7 int i,j,k,up,x,y,z,l; 8 char *c; 9 i...
分类:其他好文   时间:2015-05-03 11:55:09    阅读次数:274
卡特兰数大数相乘
计算1-100卡特兰数,必须要用数组存,大数模板注:卡特兰数:卡特兰数又称卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。由以比利时的数学家欧仁·查理·卡塔兰 (1814–1894)命名。原理: 令h(1)=1,h(0)=1,catalan数满足递归式: h(n)= h(0)*h(...
分类:其他好文   时间:2015-04-30 21:46:27    阅读次数:318
两个大数相加
通过字符串数组实现两个大数相加 1 #include 2 #include 3 #include 4 5 //大数的最大位数 6 #define MAX 100 7 8 //和的最大位数 9 #define N 10110 11 int main(int argc,char *argv[])12.....
分类:其他好文   时间:2015-04-14 16:27:32    阅读次数:137
一道腾讯校招试题
题目:猴子摘香蕉一次可以摘1个或2个,总共50个,有多少种摘法?分析:得到如下规律实际上是一个斐波那契数列以下为我使用的4种解法,分别是递归、迭代、64位整型数、数组(类似于大数相加)。代码1:递归//其中加入了计时器#include<iostream> #include<ctime> usingna..
分类:其他好文   时间:2015-04-13 21:07:56    阅读次数:178
hdu 1023 Train Problem II 这题运用到大数相乘+大数相除+卡特兰数
Problem Description As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the railway. Input The input contains sever...
分类:其他好文   时间:2015-04-03 17:22:48    阅读次数:145
234条   上一页 1 ... 14 15 16 17 18 ... 24 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!