
字符串
吴俊达9812
这个作者很懒,什么都没留下…
展开
-
计蒜客周赛第二场——凉菜鸡不会线段树
题意:https://nanti.jisuanke.com/t/38087?tdsourcetag=s_pcqq_aiomsg思路:Trie解决XOR问题(这跟线段树有什么关系。。。) 莫队暴力一发,好久不写trie了。。。#include <bits/stdc++.h>using namespace std;typedef long long ...原创 2019-05-01 11:48:54 · 164 阅读 · 0 评论 -
luogu 2022 有趣的数
我的代码能力被虐爆了,惨不忍睹。学到了数字字典序的方法,大于原数且字典序比他小的一定是他的原数减一在后面添9(10^n除外)eg: 比233大且字典序比他小的是 1000~2329 10000~23299 .....个数就是1330 13300 133000....每次做差比较即可,#include <bits/stdc++.h>using namespace...原创 2019-06-08 18:04:19 · 140 阅读 · 0 评论 -
POJ 2406 字符串循环节
后缀数组处理1e6的字符串会超时(常数比较大),换成hash或kmp对fail数组的又一个理解(移位之后匹配)这题倒着想贼好想,若循环子串,则必然满足 这个 fail 数组的性质,也可证明,满足这个性质即为循环子串#include<cstdio>#include<cstring>typedef long long LL;typedef int lint...原创 2019-06-08 14:40:20 · 511 阅读 · 0 评论 -
URAL 1297 最长回文子串(LCP模板)
//最长回文子串 , lcp 模板#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef int lint;const lint maxn = 2000 + 10;typedef int lint;struct suffix{ lint c[maxn],sa[maxn],...原创 2019-06-08 12:04:09 · 198 阅读 · 0 评论 -
distinct substrings
//本质不同的子串个数#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef int lint;const lint maxn = 1000 + 10;typedef int lint;struct suffix{ lint c[maxn],sa[...原创 2019-06-07 13:06:40 · 204 阅读 · 0 评论 -
poj 3261
//最少重叠k次的最长子串#include <vector>#include<cstdio>#include<algorithm>#include<iostream>#include<cstring>using namespace std;typedef long long LL;typedef int...原创 2019-06-07 12:18:37 · 155 阅读 · 0 评论 -
poj 1743
男人8题,又改了一次板子//最长不重叠重复子串#include <cstdio>#include<cstring>#include<iostream>using namespace std;typedef long long LL;typedef int lint;const lint maxn = 20000 + 10;const ...原创 2019-06-06 23:43:49 · 143 阅读 · 0 评论 -
Longest Common Palindrome Substring
题解:字符串hash,实测rabinkarp 算法比直接求hash值要慢1 直接求 (27ms)#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef int lint;const lint maxn = 100000 + 5;char str1[maxn],str2[max...原创 2019-06-06 19:32:36 · 190 阅读 · 0 评论 -
POJ 2774( 后缀数组模板 )
注意 :swap( x[N],y[N] ) 复杂度为O(N),不要直接swap//最长公共子串#include <cstdio>#include<cstring>#include<iostream>using namespace std;typedef long long LL;typedef int lint;c...原创 2019-06-05 21:46:28 · 207 阅读 · 0 评论 -
洛谷 P3796 AC自动机模板
题意:统计出现次数最多的字符串,按照输入顺序输出这些字符串#include <bits/stdc++.h>using namespace std;typedef int LL;const LL maxn = 500000 + 100;LL re = -1,ma[maxn],ccnt[maxn];void init(){ memset( ccnt,0,sizeof...原创 2019-05-22 21:16:14 · 132 阅读 · 0 评论 -
luoguP1032
字符串骚操作str.repalce( int s,int len,string str )将起点为s,长度为len的字符串替换成strstr.insert( int s,string str )起点为s,插入str划重点,这题要是用insert一首凉凉。因为删除操作后下表会改变,insert个鬼哦#include <bits/stdc++.h>using ...原创 2019-05-26 21:14:10 · 145 阅读 · 0 评论 -
B - Balala Power!
字符串的字典序可以看作为26进制数字的大小坑点:大数比较大小需要注意 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef int lint; const lint maxn = 1000020; const LL mod = 1e...原创 2019-07-13 21:56:41 · 533 阅读 · 0 评论