字符串
Weach
学生
展开
-
AcWing 831. KMP字符串
P3375 【模板】KMP字符串匹配 #include<bits/stdc++.h> #include <unordered_map> using namespace std; template <typename T> void debug(string s, T x) { cout << s << "=" << x << "\n"; } typedef long long ll; typedef unsigned lon原创 2021-07-14 15:29:33 · 101 阅读 · 0 评论 -
字符串的一些模板
#include<bits/stdc++.h> #include <unordered_map> using namespace std; template<class...Args> void debug(Args... args) {//Parameter pack auto tmp = { (cout << args << ' ', 0)... }; cout << "\n"; } typedef long lon原创 2021-08-13 17:32:56 · 229 阅读 · 0 评论 -
后缀数组学习笔记
P3809 【模板】后缀排序 da(倍增)解法 #include<bits/stdc++.h> #include <unordered_map> using namespace std; template<class...Args> void debug(Args... args) {//Parameter pack auto tmp = { (cout << args << ' ', 0)... }; cout <<.原创 2021-08-13 11:30:35 · 71 阅读 · 0 评论 -
最长回文字串--马拉车(Manacher)算法模板
139. 回文子串的最大长度 #include<bits/stdc++.h> #include <unordered_map> using namespace std; template<class...Args> void debug(Args... args) {//Parameter pack auto tmp = { (cout << args << ' ', 0)... }; cout << "\n"; } t原创 2021-07-27 20:59:14 · 123 阅读 · 0 评论 -
手写进制转换
任意2-36进制数转化为10进制数 //任意2-36进制数转化为10进制数 int Atoi(string s, int radix){//s是给定的radix进制字符串 int ans = 0; for (int i = 0; i < s.size(); i++){ char t = s[i]; if (t >= '0' && t <= '9') ans = ans * radix + t - '0'; el原创 2021-07-26 11:23:00 · 218 阅读 · 0 评论 -
AC自动机详解
Keywords Search #include<bits/stdc++.h> #include <unordered_map> using namespace std; template<class...Args> void debug(Args... args) {//Parameter pack auto tmp = { (cout << args << ' ', 0)... }; cout << "\n"; }原创 2021-07-21 17:04:37 · 295 阅读 · 0 评论 -
Codeforces Round #724 (Div. 2) B. Prinzessin der Verurteilung--sting的用法
Codeforces Round #724 (Div. 2) B. Prinzessin der Verurteilung #include<bits/stdc++.h> using namespace std; template <typename T> void debug(string s, T x) { cout << s << "=" << x << "\n"; } typedef long long ll; typedef原创 2021-06-09 20:37:23 · 182 阅读 · 1 评论 -
小圆前辈的博弈--字典树
小圆前辈的博弈 #include<bits/stdc++.h> using namespace std; template <typename T> void debug(string s,T x) { cout <<s<< "=" << x << "\n"; } typedef long long ll; typedef unsigned long long ull; const ll N = 2e3 + 5; const ll MO原创 2021-04-26 19:46:33 · 123 阅读 · 0 评论 -
AcWing 138. 兔子与兔子--字符串哈希
AcWing 138. 兔子与兔子 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const ll N = 1e7 + 5; const ll MOD = 1e9 + 7; const ll INF = 0x7fffffff; const ll base = 131; ull h[N], p[N]; char str[N]; ull solv.原创 2021-04-21 21:53:35 · 90 阅读 · 1 评论 -
字典树学习笔记
HDU1251–统计难题 数组实现版本 #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll N = 1e6+5; const ll MOD = 1e9 + 7; const ll INF = 0x7fffffff; ll trie[N][26]; //数组形式定义字典树,值存储的是下一个字符的位置 ll num[N]; //附加值,以某一字符串为前缀的单词的数量 ll pos = 1;原创 2021-04-20 16:24:55 · 83 阅读 · 0 评论 -
几道KMP模板题
几道KMP的模板题 记录下KMP学习过程 注意:这里的模板s1是文本串s2是匹配串(模式串) HDU1711 Number Sequence链接 最小匹配位置 #include<iostream> #include<bits/stdc++.h> #include<queue> #include<vector> using namespace std; typedef long long ll; const ll maxn=1e6+5; const ll MOD原创 2020-09-09 21:03:06 · 204 阅读 · 0 评论