随笔分类 - 字符串——KMP/扩展kmp
摘要:题意: 给出2个串s和t 要求从s中选出连续一段区间[i,j],拼接上t的前k个字符是回文串 且区间[i,j]长度要大于k 问三元组(i,j,k)有多少种 s中选出的区间长度要大于t的前缀,且要拼接出来是回文串 等价于 s选出的区间中,后一块是自回文的,前一块拼上t的前缀是回文串 等价于 s选出的区
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3670 法一:KMP+st表 抽离nxt数组,构成一棵树 若nxt[i]=j,则i作为j的子节点 那么num[i] 就是i到根节点的路径上,所有<=i/2 的节点的个数 这棵树的点随深度的递增而增大 所
阅读全文
摘要:期望得分:100+100+20=220 实际得分:100+100+20=220 模拟栈 #include<cstdio> #include<cstring> using namespace std; #define N 10002 char s[N],st[N]; int top; int main
阅读全文
摘要:1009: [HNOI2008]GT考试 Description 阿申准备报名参加GT考试,准考证号为N位数X1X2....Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字。他的不吉利数学A1A2...Am(0<=Ai<=9)有M位,不出现是指X1X2...Xn中没有恰好一段等于A1A2
阅读全文
摘要:T1 黑化 题意: 求一个字符串是否可能包含另一个字符串 字符串中的?可以匹配任意字母 可能输出 God bless You! 一定不可能 输出 Game Over! 计算fail数组时,fail数组不具有传递性 例: pqkbpqsbqszzpqkbpq?z 在z处失配后: pqkbpqsbqsz
阅读全文
摘要:Finding Palindromes http://poj.org/problem?id=3376 Time Limit: 10000MS Memory Limit: 262144K Case Time Limit: 2000MS Description A word is called a pa
阅读全文
摘要:Clairewd’s message http://acm.hdu.edu.cn/showproblem.php?pid=4300 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Pro
阅读全文
摘要:Theme Section http://acm.hdu.edu.cn/showproblem.php?pid=4763 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem
阅读全文
摘要:重叠的最长子串 http://ac.jobdu.com/problem.php?pid=1535 时间限制:1 秒 内存限制:128 兆 题目描述: 给定两个字符串,求它们前后重叠的最长子串的长度,比如"abcde"和“cdefg”是"cde",长度为3。 输入: 输入可能包含多个测试案例。对于每个
阅读全文
摘要:Revolving Digits http://acm.hdu.edu.cn/showproblem.php?pid=4333 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Probl
阅读全文
摘要:String Problem http://acm.hdu.edu.cn/showproblem.php?pid=3374 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su
阅读全文
摘要:Binary Witch http://poj.org/problem?id=2541 Time Limit: 1000MS Memory Limit: 65536K Description Once upon a time in the silent depths of digital fores
阅读全文
摘要:Infinite monkey theorem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)http://acm.hdu.edu.cn/showproblem.php?pid=3689
阅读全文
摘要:Milking Grid http://poj.org/problem?id=2185 Time Limit: 3000MS Memory Limit: 65536K Description Every morning when they are milked, the Farmer John's
阅读全文
摘要:Period http://poj.org/problem?id=1961 Time Limit: 3000MS Memory Limit: 30000K Description For each prefix of a given string S with N characters (each
阅读全文
摘要:Cyclic Nacklace http://acm.hdu.edu.cn/showproblem.php?pid=3746 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Proble
阅读全文
摘要:Power Strings http://poj.org/problem?id=2406 Time Limit: 3000MS Memory Limit: 65536K Description Given two strings a and b we define a*b to be their c
阅读全文
摘要:bzoj 1355: [Baltic2009]Radio Transmission http://www.lydsy.com/JudgeOnline/problem.php?id=1355 Description 给你一个字符串,它是由某个字符串不断自我连接形成的。 但是这个字符串是不确定的,现在只
阅读全文
摘要:Seek the Name, Seek the Fame http://poj.org/problem?id=2752 Time Limit: 2000MS Memory Limit: 65536K Description The little cat is so famous, that many
阅读全文
摘要:Count the string Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)http://acm.hdu.edu.cn/showproblem.php?pid=3336 Proble
阅读全文