![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
高精度
skymeteorite
这个作者很懒,什么都没留下…
展开
-
大数加法
#include<iostream> #include<string> using namespace std; string sum(string s1,string s2) { if(s1.length()<s2.length()) { string temp=s1; s1=s2; s2=temp; }原创 2015-07-09 16:58:45 · 293 阅读 · 0 评论 -
hdu 1316 How Many Fibs?
题目(http://acm.hdu.edu.cn/showproblem.php?pid=1316)Problem Description Recall the definition of the Fibonacci numbers: f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n >= 3) Given two numbers a and b, calculate原创 2015-08-13 17:27:06 · 220 阅读 · 0 评论 -
hdu1250 Hat's Fibonacci 高精度
题目(http://acm.hdu.edu.cn/showproblem.php?pid=1250)Problem Description A Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1. F(1) =原创 2015-08-13 17:37:18 · 405 阅读 · 0 评论 -
hdu1023 高精度
http://acm.hdu.edu.cn/showproblem.php?pid=1023卡特兰数,用递推公式h(n)=h(n-1)*(4*n-2)/(n+1);#include <iostream> #include <cstdio> using namespace std; int a[101][101]={0}; int main() { int n,i,j,len,r,temp,t原创 2016-06-23 21:06:20 · 304 阅读 · 0 评论 -
hdu1018
求n!有多少位 1. log10(n!)=log10(1)+···log10(n) 2. Stirling公式 当n->无穷 故n!的位数为 #include #include #include #include #define PI acos(-1) #define e 2.718281828 using namespace std原创 2018-01-07 22:59:31 · 247 阅读 · 0 评论 -
N的阶乘
https://www.nowcoder.com/practice/f54d8e6de61e4efb8cce3eebfd0e0daa?tpId=40&tqId=21355&rp=1&ru=%2Fta%2Fkaoyan&qru=%2Fta%2Fkaoyan%2Fquestion-ranking&tPage=2即用数组a,数组中的每个元素存储4位数,, 比如,计算9的阶乘,在计算到7的阶乘时,7!为5原创 2018-03-03 12:16:24 · 493 阅读 · 0 评论