字符串
weixin_44705665
这个作者很懒,什么都没留下…
展开
-
HDU 2072
最近烧饼接到了一个任务,要求统计一篇文章中出现的不同单词的个数。但是烧饼觉得这个任务太简单了,所以他把这个任务交给了你,你能帮助他吗?Input多组数据,每组一行,表示一篇文章。文章只由小写字母和空格构成。遇到#时表示输入结束Output每组输入输出一个整数,单独成行,表示这篇文章里不同单词的总数。Sample Inputyou are my friendSample Outpu...原创 2019-08-04 16:03:57 · 368 阅读 · 0 评论 -
poj1226 kmp查找多字符串正逆最长子串或stl中string法
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.Inpu...原创 2019-08-28 10:46:46 · 91 阅读 · 0 评论 -
HDU3336(KMP+DP)
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:s: "abab...原创 2019-08-27 21:11:01 · 95 阅读 · 0 评论 -
HDU 2594 KMP求两字符串合并后的前后缀
Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have a talent in politics...原创 2019-08-27 19:57:07 · 90 阅读 · 0 评论 -
POJ 3080 找出m个串中的最长公共子串 二分+爆搜+set
The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was populated....原创 2019-08-27 19:26:32 · 67 阅读 · 0 评论 -
HDU - 3068 最长回文(Manacher(马拉车)算法模板题)
给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一个整数x,对应一组...原创 2019-08-27 16:10:57 · 104 阅读 · 0 评论 -
POJ 2752 KMP求前缀后缀的最大匹配长度
The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek th...原创 2019-08-27 14:24:49 · 510 阅读 · 0 评论 -
POJ 2406 Power Strings(KMP求循环次数)
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-...原创 2019-08-27 13:20:05 · 73 阅读 · 0 评论 -
POJ 1961 (KMP求最长连续重复字串)
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 ...原创 2019-08-27 11:24:16 · 217 阅读 · 0 评论 -
HDU3746 Cyclic Nacklace (KMP求循环节)
CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about how to...原创 2019-08-27 10:48:01 · 81 阅读 · 0 评论 -
HDU 2087 剪花布条(KMP 模板求不叠加模式串个数)
一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。Output...原创 2019-08-27 09:11:20 · 77 阅读 · 0 评论 -
HDU 1686 Oulipo(KMP算法求模式串在目标串中的个数)
The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais tout s’...原创 2019-08-26 21:51:45 · 143 阅读 · 0 评论 -
HDU 1711 Number Sequence(KMP算法求模式串开头位置)
Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K ...原创 2019-08-26 21:06:24 · 77 阅读 · 0 评论 -
HDU 1075
小智有一只神奇的电耗子(就决定是你了,皮卡丘!),它每天都会写很多东西,但是他看不懂这只黄皮耗子整天在写些什么。有一天他突然收到一个快递。他拆开后发现是一个字典,他就好奇地翻了起来,结果发现把皮卡丘写的东西和字典里的东西一对比,竟然能翻译成英文,他很想把皮卡丘写的东西全部翻一下来,你能帮他把皮卡丘写的东西翻译成英文吗?Input本题只有一组数据,所有单词只包含小写字母。测试用例由两部分组成,字...原创 2019-08-04 20:48:57 · 515 阅读 · 0 评论 -
Hdu 6153 A Secret(KMP求子串在母串中的前缀长度和)
Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things that VS tell:Suff...原创 2019-08-29 10:44:38 · 80 阅读 · 0 评论