1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N = 1e5; 4 char A[N],B[N]; 5 int a[N],b[N],c[N],na,nb; 6 void change(){ 7 for(int i=0; i< ...
分类:
其他好文 时间:
2020-03-11 01:32:29
阅读次数:
74
首先声明的是这种解法非常非常的原始和不优雅,甚至比暴力递推还要臭长。 对于最长回文子串这种经典的老题目,有很多亮眼的解法,比如与逆序串取交集。 但我们解决问题不能总是依靠这种眼前一亮(虽然很少亮那么一下),我们应该有一些通用的思考方法,可以用来解决绝大部分问题。 问题的解决都有递归和递推的两种描述, ...
分类:
其他好文 时间:
2020-03-11 01:28:31
阅读次数:
68
1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 const int N = 1e5+5; 6 7 char a[N],b[N]; 8 9 struct bign{ 10 int d[N]; 11 int len; 12 bign(){ 1 ...
分类:
其他好文 时间:
2020-03-11 01:16:04
阅读次数:
44
高精度运算,是指参与运算的数(加数,减数,因子……)范围大大超出了标准数据类型(整型,实型)能表示的范围的运算。例如,求两个20000位的数的和。这时,就要用到高精度算法了。 1、高精度加法 #include<cstdio>#include<iostream>#include<cstring>usi ...
分类:
其他好文 时间:
2020-03-10 20:07:47
阅读次数:
76
1 void doit(){ 2 //字符串采用快速读入 从1开始 3 pre=0; 4 next[0]=0;next[1]=0;//起点标记 5 FOR(suf,2,lenx){ 6 while(pre>0&&x[suf]!=x[pre+1]) pre=next[pre]; //递推求最大公共前后 ...
分类:
其他好文 时间:
2020-03-10 15:46:06
阅读次数:
65
#include<iostream> #include<string> using namespace std; const int Max = 550; int Compare(int a[], int b[]); void Plus(int a[], int b[], int n); void ...
分类:
其他好文 时间:
2020-03-09 18:21:30
阅读次数:
73
#include<iostream> #include<string> using namespace std; const int Max = 20000; int Compare(int a[], int b[]); //比较大小 void Subtract(int a[], int b[]); ...
分类:
其他好文 时间:
2020-03-09 18:06:28
阅读次数:
65
集合 偏序集 偏序集合:指配备了部分排序关系的集合。 对非空集合 A 上的关系 R,如果 R 是自反的、反对称的和传递的,则称 R 为 A 上的偏序关系。 偏序关系 R (记作 $\preceq$ ): 自反性:对任意 $\forall a \in A$,有 $ \in R$ 反对称性:$\fora ...
分类:
其他好文 时间:
2020-03-09 18:01:11
阅读次数:
49
#include<iostream> #include<string> using namespace std; const int Max = 550; void Enlarge(int p[], int q[], int bits); //将数组p的数字串右移bits位 int Compare( ...
分类:
其他好文 时间:
2020-03-09 17:56:50
阅读次数:
52
逆序思维 当爬到第K级台阶时,上一步只有两种可能,一种是位于K-1,一种是位于K-2 参考https://www.luogu.com.cn/blog/user7117/solution-p1255 #include<iostream> #include<string> using namespace ...
分类:
其他好文 时间:
2020-03-09 17:56:00
阅读次数:
67