![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
高精度算法
wwt9b15bs
这个作者很懒,什么都没留下…
展开
-
【题解】UVA10328 线性DP+大整数
题目链接 大整数型是NM什么鬼东西(雾) 首先是逆向思维,c[i][j]表示的是投掷i次,连续正面的个数最多不超过j次的情况有多少种,然后c[i][j] = c[i - 1][j] * 2,无非是第i次增加了两种情况,正面和反面,但是这样计算是要有些不符合条件的情况也考虑进去了,即c[i-1][j]会有说后面的j个为正面,那么在增加一个正面的话连续正面的个数就会变成j + 1个,所以要减去这种...原创 2018-08-18 07:37:08 · 113 阅读 · 0 评论 -
【题解】洛谷P1601A+B Problem(高精) 高精度
题目链接 #include<cstdio> #include<cstring> int a[1010],b[1010],c[1010]; char s[1010]; int main() { scanf("%s",&s); int len=strlen(s),k=0; for(int i=len-1;i>=0;原创 2018-09-04 10:42:42 · 295 阅读 · 0 评论 -
【题解】洛谷P2142高精度减法 高精度
题目链接 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=1e5+10; int a[N],b[N],c[N]; char s1[N],s2[N]; bool flag=false; void sub() { int i;...原创 2018-09-04 10:42:49 · 374 阅读 · 0 评论 -
【题解】洛谷P1255数楼梯 递推+高精度
题目链接 就只是把斐波拉契数列高精度计算 #include<cstdio> #define _rep(i,a,b) for(int i=(a);i<=(b);i++) const int N=5e3+10; const int base=1e4;//万进制 int n; int fib[N][2010];//fib[i][j]第i项的第j位 int main() { ...原创 2018-09-04 10:42:58 · 262 阅读 · 0 评论 -
【题解】洛谷P1604B进制星球 进位计数制+高精度
题目链接 #include<cstdio> #include<cstring> #include<cctype> const int N=2e5+10; int base; int a[N],b[N],c[N]; char s[N]; void add() { int i=0; while(i<=a[0]||i<原创 2018-09-04 10:43:10 · 260 阅读 · 0 评论 -
【题解】poj1220 NUMBER BASE CONVERSION 高精度+进位计数制
题目链接 Description Write a program to convert numbers in one base to numbers in a second base. There are 62 different digits: { 0-9,A-Z,a-z } HINT: If you make a sequence of base conversions using...原创 2018-09-10 07:17:18 · 189 阅读 · 0 评论 -
【题解】洛谷P1045麦森数[NOIP2003普及] 高精快速幂
题目链接 #include<cstdio> #include<cmath> #include<cstring> const int N=3e3+10; int p,n; int a[N],b[N],c[N]; void mul(int *a,int *b) { memset(c,0,sizeof(c)); for(int i=1;i...原创 2018-09-17 09:23:43 · 277 阅读 · 0 评论 -
【题解】洛谷P2152(LibreOJ10205)[SDOI2009]Super GCD 高精度+更相减损术
题目链接 题目描述 Sheng bill有着惊人的心算能力,甚至能用大脑计算出两个巨大的数的GCD(最大公约 数)!因此他经常和别人比赛计算GCD。有一天Sheng bill很嚣张地找到了你,并要求和你比 赛,但是输给Sheng bill岂不是很丢脸!所以你决定写一个程序来教训他。 输入输出格式 输入格式: 共两行: 第一行:一个数AAA。 第二行:一个数BBB。 输出格式: 一行,表示AAA和B...原创 2018-09-20 09:18:19 · 378 阅读 · 0 评论