![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM-字符串
黄金四叶草
Accepted
展开
-
HDU 4749 Parade Show 数据结构KMP变形
Parade Show Every student has its own number, from 1 to n. (1<=n<=10^5), and they are standing from 1 to n in the increasing order the same with their number order. According to requirement of sch原创 2016-07-23 12:20:30 · 321 阅读 · 0 评论 -
XTU Lisa's Puzzle 裸的字典树
Lisa's Puzzle[ Submit Code ] [ Top 20 Runs ] [ Runs Status ]Acceteped : 38 Submit : 190Time Limit : 1000 MS Memory Limit : 65536 KB Description原创 2016-09-17 00:34:48 · 1170 阅读 · 0 评论 -
UVALive 3026 period(周期) kmp算法的应用
周期 给定一个长度为n的字符串S,求它的每个前缀的最短循环节,换句话说,对于每个i,i属于2到n,求一个最大的整数K>1(如果K存在)使得S的前i个字符组成的前缀是某个字符串重复K次得到的。输出所有存在K的i和对应的K。样例输入:12aabaabaabaab3aaa样例输出: Test case #12 26 29原创 2016-07-16 16:44:16 · 535 阅读 · 0 评论 -
UVA 11732 "strcmp()" Anyone? 前缀树(Trie)+简单搜索
"strcmp()" Anyone?比较两个字符串的大小用strcmp()函数,对于这个函数而言,比较两个字符串如“than”和“that”需要7次因为(s[i]==t[i]和s[i]=='\0'各算一次)题目要求:给你一堆字符串(数字加字母大小写),求两两调用一次strcmp总的比较次数是多少?样例输入2ab4cathatmatsir0原创 2016-07-15 18:04:40 · 290 阅读 · 0 评论 -
UVALive 3942 Remember the Word 前缀树Trie
Remember the Word给出一个由S个不同单词组成的字典和一个长字符串,把这个字符串分解成若干个单词的连接(单词可以重复使用),有多少种方法sample input:abcd4abcdabsampsample outputCase 1 : 2解题思路:这题为什么会用前缀树来做呢,既然是要找有多少种分解方法,其实关键点原创 2016-07-15 15:13:45 · 210 阅读 · 0 评论 -
hiho 1032 && HDU 3068 manacher算法
两个题目的链接分别为:hiho:http://hihocoder.com/problemset/problem/1032hdu:acm.hdu.edu.cn/showproblem.php?pid=3068manacher算法是用来快速的求得一个字符串中最长的回文串:其思想就是利用顺序求得的前面的回文串的长度确定后面的未知的回文串的长度,减小复杂度的。有一篇写的比较好的文章原创 2016-07-14 14:44:20 · 257 阅读 · 0 评论 -
hiho 1015 KMP算法
#1015 : KMP算法时间限制:1000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一只河蟹,于是河蟹就向小Hi和小Ho提出了那个经典的问题:“小Hi和小Ho,你们能不能够判断一段文字(原串原创 2016-07-14 10:02:54 · 344 阅读 · 0 评论 -
HDU 1671 phone list 数据结构+Trie树(字典树、前缀树)
phone list Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionGiven a list of phone numbers, determine if it is consistent in the se原创 2016-07-23 16:35:28 · 370 阅读 · 0 评论 -
POJ 2001 Shortest Prefixes 数据结构Trie树(字典树、前缀树)
Shortest PrefixesTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionA prefix of a string is a substring starting at the beginning of the giv原创 2016-07-23 15:57:54 · 379 阅读 · 0 评论 -
POJ 2406 Power Strings 数据结构+KMP
Power StringsTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionGiven two strings a and b we define a*b to be their concatenation. For原创 2016-07-23 15:31:08 · 229 阅读 · 0 评论 -
HDU 1867 A + B for you again 数据结构+KMP简单应用
A + B for you again 数据结构+KMP简单应用Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionGenerally speaking, there are a lot of problems about s原创 2016-07-23 15:20:35 · 238 阅读 · 0 评论 -
HDU 2087 剪花布条简单KMP
剪花布条简单KMPTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescription一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?原创 2016-07-23 15:04:31 · 220 阅读 · 0 评论 -
HDU 3746 Cyclic Nacklace 数据结构+kmp周期类问题
Cyclic NacklaceTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionCC always becomes very depressed at the end of this month, he has chec原创 2016-07-23 14:55:27 · 233 阅读 · 0 评论 -
HDU 3336 Count the string 数据结构+扩展KMP
Count the stringTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionIt is well known that AekdyCoin is good at string problems as well as原创 2016-07-23 13:44:56 · 235 阅读 · 0 评论 -
HDU 5918 Sequence I kmp算法+虽然暴力也能过
Sequence ITime Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 211 Accepted Submission(s): 90Problem DescriptionMr. Frog has two seque原创 2016-10-04 21:46:00 · 369 阅读 · 0 评论