
字符串_Trie
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
HDU1251 Trie树
DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,转载 2013-01-31 21:51:45 · 531 阅读 · 0 评论 -
大视野1212--[HNOI2004]L语言(Trie+DP)
Description标点符号的出现晚于文字的出现,所以以前的语言都是没有标点的。现在你要处理的就是一段没有标点的文章。 一段文章T是由若干小写字母构成。一个单词W也是由若干小写字母构成。一个字典D是若干个单词的集合。 我们称一段文章T在某个字典D下是可以被理解的,是指如果文章T可以被分成若干部分,且每一个部分都是字典D中的单词。 例如字典D中包括单词{‘is’, ‘name’, ‘wha原创 2014-07-25 15:52:07 · 833 阅读 · 0 评论 -
POJ1816--Wild Words(Trie+搜索)
DescriptionA word is a string of lowercases. A word pattern is a string of lowercases, '?'s and '*'s. In a pattern, a '?' matches any single lowercase, and a '*' matches none or more lowercases.原创 2014-03-26 22:00:18 · 1390 阅读 · 0 评论 -
POJ2513--Colored Sticks
DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints原创 2013-03-21 09:49:42 · 860 阅读 · 0 评论 -
UVA 11732 strcmp()函数
strcmp() is a library function in C/C++ which compares two strings. It takes two strings as input parameter and decides which one is lexicographically larger or smaller: If the first string is greater原创 2014-02-22 22:35:43 · 877 阅读 · 0 评论 -
UVA10887--Trie--哈希
A language is a set of strings. And the concatenation of two languages is the set of all strings that are formed by concatenating the strings of the second language at the end of the strings of the fi原创 2014-03-06 18:18:16 · 828 阅读 · 0 评论 -
UVA261--The Window Property
The Window PropertySuppose you are given a sequence of symbols but you can see only k ( ) consecutive symbols at a time. Then we say the length of the window is k. Moving this window原创 2014-03-07 10:49:54 · 722 阅读 · 0 评论 -
POJ1002--487-3279
DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University原创 2014-03-10 20:28:35 · 685 阅读 · 0 评论 -
UVA 11488,Hyper Prefix Sets,Trie树
Prefix goodness of a set string is length of longest common prefix*number of strings in the set. For example the prefix goodness of the set {000,001,0011} is 6.You are given a set of binary strings. F原创 2014-02-28 19:45:38 · 797 阅读 · 0 评论 -
LA3942 Remember the world
Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowing that Ray has a photographic memory and this may not trouble him, Neal gives it to Jiejie.Since Ji原创 2014-02-22 14:12:11 · 1099 阅读 · 0 评论 -
HDU3172--Virtual Friends
Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends,原创 2013-04-11 14:17:10 · 829 阅读 · 0 评论 -
Codeforces Round #170 (Div. 2)Tire--KMP
Coming up with a new problem isn't as easy as many people think. Sometimes it is hard enough to name it. We'll consider a titleoriginal if it doesn't occur as a substring in any titles of recent Cod原创 2013-03-01 15:44:22 · 525 阅读 · 0 评论 -
POJ308--Blue Jeans--后缀树
DescriptionThe 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原创 2013-02-20 12:49:31 · 756 阅读 · 0 评论 -
POJ1035--Spell checker--Tire
DescriptionYou, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all correct words原创 2013-02-14 16:03:25 · 531 阅读 · 0 评论 -
CF 455B-- A Lot of Games
Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players.Given a group of n non-empty strings. During the game two players build the word together, initiall原创 2014-08-09 15:11:38 · 946 阅读 · 0 评论