随笔分类 - KMP算法 & 后缀数组 & AC自动机
摘要:DNA SequenceTime Limit:1000MSMemory Limit:65536KTotal Submissions:9889Accepted:3712DescriptionIt's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For example, if a animal's DNA sequence contains segment AT
阅读全文
摘要:DNA repairTime Limit:2000MSMemory Limit:65536KTotal Submissions:4815Accepted:2237DescriptionBiologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of simplicity, a DNA is represented as a string containing characters 'A'
阅读全文
摘要:Rescue the RabbitTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1010Accepted Submission(s): 274Problem DescriptionDr. X is a biologist, who likes rabbits very much and can do everything for them. 2012 is coming, and Dr. X wants to take some rabb
阅读全文
摘要:SubstringsTime Limit:1000MSMemory Limit:10000KTotal Submissions:10244Accepted:3515DescriptionYou 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.InputThe first
阅读全文
摘要:694. Distinct SubstringsProblem code: DISUBSTRhttp://www.spoj.com/problems/DISUBSTR/Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. T<=20;Each test case consists of one string, whose length is <= 1000OutputFor each test case output one
阅读全文
摘要:Milk PatternsTime Limit:5000MSMemory Limit:65536KTotal Submissions:7748Accepted:3522Case Time Limit:2000MSDescriptionFarmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of mi
阅读全文
摘要:Musical ThemeTime Limit:1000MSMemory Limit:30000KTotal Submissions:14584Accepted:5026DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this representation
阅读全文
摘要:Computer Virus on Planet PandoraTime Limit : 6000/2000ms (Java/Other)Memory Limit : 256000/128000K (Java/Other)Total Submission(s) : 12Accepted Submission(s) : 5Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionAliens on planet Pandora also write computer programs like us. Their pro
阅读全文
摘要:DNA repairTime Limit : 5000/2000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 2Accepted Submission(s) : 2Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionBiologists finally invent techniques of repairing DNA that contains segments causing kinds of inh
阅读全文
摘要:Clairewd’s messageTime Limit : 2000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 16Accepted Submission(s) : 7Problem DescriptionClairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messages and she was preparing for s
阅读全文
摘要:Cyclic NacklaceTime Limit : 2000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 10Accepted Submission(s) : 8Problem DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 9
阅读全文
摘要:Best RewardTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/65536K (Java/Other)Total Submission(s) : 23Accepted Submission(s) : 8Problem DescriptionAfter an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great explo
阅读全文
摘要:String Problem Problem Description Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SK
阅读全文
摘要:Count the stringTime Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 22 Accepted Submission(s) : 11Problem DescriptionIt 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
阅读全文
摘要:A + B for you againTime Limit : 5000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 30Accepted Submission(s) : 9Problem DescriptionGenerally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two string
阅读全文
摘要:Life FormsTime Limit:5000MSMemory Limit:65536KTotal Submissions:7270Accepted:1998DescriptionYou may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resemblance; thes
阅读全文
摘要:病毒侵袭持续中Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3920Accepted Submission(s): 1408 Problem Description小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶之源”。这是一个庞大的病毒网站,他有着好多好多的病毒,但是这个网站包含的病毒很奇怪,这些病毒的特征码很短,而且只包含“英文大写字符”。当然小t好想好想为民除害,但是小t从来不打
阅读全文
摘要:病毒侵袭Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6515Accepted Submission(s): 1721 Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此
阅读全文
摘要:Keywords SearchTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 22721Accepted Submission(s): 7553 Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc. Wiskey also wants to bring this feature
阅读全文
摘要:1451.字符串的移动http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1451Time Limit: 1000 MS Memory Limit: 65536 K Total Submissions: 14 (6 users) Accepted: 2 (2 users) [ My Solution ] Description给定非空字符串S和正整数k, 我们定义函数Shift(S, k)表示将字符串S循环右移k位, 例如Shift("abc", 1) = "cab", Shift("abc&quo
阅读全文