
字符串
文章平均质量分 70
tokers
所有的魅力在“习惯”面前都将无色。
展开
-
hdu4825---Xor Sum(Trie + 贪心)
Problem Description Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意原创 2015-05-25 14:59:25 · 930 阅读 · 0 评论 -
SPOJ687---REPEATS - Repeats(后缀数组+RMQ)
A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the strings = abaabaabaabais a (4,3)-repeat with t = aba as its seed原创 2015-04-07 19:43:33 · 908 阅读 · 0 评论 -
POJ1226---Substrings(后缀数组+二分)
Description 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 str原创 2015-04-07 17:59:32 · 661 阅读 · 0 评论 -
hdu4691---Front compression(后缀数组+RMQ)
Front compression Time Limit: 5000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others) Total Submission(s): 1490 Accepted Submission(s): 553Problem Description Front compression原创 2015-04-18 14:04:40 · 938 阅读 · 0 评论 -
WHU---1084 - 连续技 (后缀数组+二分)
Description 不管是什么武功,多少都会有一或两个连续技多次出现,这些连续技常常是发明该武功的人的习惯性动作,如果这些动作被对手分析出来了,就很容易被对手把握住先机。比如松风剑谱里面有一式叫做迎风傲骨是如下的动作: 劈 刺 削 刺 削 踢 刺 削 刺 削 很明显 刺-削 这个连续动作出现了4次,而 刺-削-刺-削 这个连续动作则出现了两次。现在刘白宇弄到了一本魔教的掌法,想让你帮忙来分原创 2015-04-10 18:36:24 · 868 阅读 · 0 评论 -
POJ3294---Life Forms(后缀数组,二分+给后缀分组)
DescriptionYou 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原创 2015-04-04 10:47:52 · 1827 阅读 · 0 评论 -
Codeforces Round #166 (Div. 2)---D. Good Substrings(字符串)
You’ve got string s, consisting of small English letters. Some of the English letters are good, the rest are bad.A substring s[l…r] (1 ≤ l ≤ r ≤ |s|) of string s = s1s2…s|s| (where |s| is the length原创 2015-04-01 17:59:06 · 747 阅读 · 0 评论 -
SPOJ694--- DISUBSTR - Distinct Substrings(后缀数组)
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 <= 1000 OutputFor each test c原创 2015-03-31 19:03:37 · 776 阅读 · 0 评论 -
POJ3261---Milk Patterns(后缀数组+二分)
DescriptionFarmer 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 milk from one原创 2015-03-31 18:18:50 · 765 阅读 · 0 评论 -
POJ1743---Musical Theme(后缀数组+二分)
Description A 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 repre原创 2015-03-31 16:30:48 · 982 阅读 · 1 评论 -
SPOJ220---Relevant Phrases of Annihilation(后缀数组+二分,对后缀分组)
You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your island. You immedietaly send for the Bytelandian Cr原创 2015-04-07 21:43:21 · 878 阅读 · 0 评论 -
POJ3581---Sequence(后缀数组)
DescriptionGiven a sequence, {A1, A2, …, An} which is guaranteed A1 > A2, …, An, you are to cut it into three sub-sequences and reverse them separately to form a new one which is the smallest possible原创 2015-04-08 15:41:28 · 1309 阅读 · 0 评论 -
hdu4511---小明系列故事——女友的考验(AC自动机+dp)
小明系列故事——女友的考验 Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 863 Accepted Submission(s): 192Problem Description 终于放寒假了,小明要和女朋友一起去看电影。这天,女原创 2015-04-20 15:03:35 · 1206 阅读 · 0 评论 -
hdu1403---Longest Common Substring(后缀数组求2个字符串的最长公共子串)
Problem Description Given two strings, you have to tell the length of the Longest Common Substring of them.For example: str1 = banana str2 = cianaicSo the Longest Common Substring is “ana”, and the原创 2015-04-09 14:47:17 · 1393 阅读 · 0 评论 -
hdu4758---Walk Through Squares(AC自动机+dp)
Problem DescriptionOn the beaming day of 60th anniversary of NJUST, as a military college which was Second Artillery Academy of Harbin Military Engineering Institute before, queue phalanx is a special原创 2015-04-16 16:07:30 · 1102 阅读 · 0 评论 -
ZOJ3545---Rescue the Rabbit(AC自动机+dp)
Dr. 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 rabbits to Noah’s Ark, or there are no rabbits any more.A rabbit’s genes c原创 2015-04-20 16:17:36 · 1098 阅读 · 0 评论 -
hdu4080---Stammering Aliens(后缀数组+二分)
Problem Description Dr. Ellie Arroway has established contact with an extraterrestrial civilization. However, all efforts to decode their messages have failed so far because, as luck would have it, th原创 2015-04-15 20:56:59 · 1003 阅读 · 0 评论 -
NOJ1222-English Game(AC自动机+dp)
问题描述This English game is a simple English words connection game.The rules are as follows: there are N English words in a dictionary, and every word has its own weight v. There is a weight if the corre原创 2015-04-16 12:49:06 · 776 阅读 · 0 评论 -
hdu4416---Good Article Good sentence
Good Article Good sentence Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2586 Accepted Submission(s): 728Problem Description In middle s原创 2015-04-09 18:59:13 · 904 阅读 · 0 评论 -
hdu3518---Boring counting(后缀数组,对后缀分组)
Problem Description 035 now faced a tough problem,his english teacher gives him a string,which consists with n lower case letter,he must figure out how many substrings appear at least twice,moreover,s原创 2015-04-09 14:25:55 · 755 阅读 · 0 评论 -
WHU1572---Cyy and Fzz (AC自动机+dp)
Description As Cyy and Fzz are both busy repairing the network, Sama feel a little boring because it’s he who select Teemo during that game. Of cause his Teemo will stay alive since he has used the su原创 2015-04-20 13:29:18 · 1202 阅读 · 0 评论 -
WHU1564---Circle (后缀数组)
Description Here is a circle sequence S of length n, and you can choose a position and remove the number on it. After that,you will get a integer. More formally,you choose a number x( 1<=x<=n ),then原创 2015-04-20 13:28:24 · 1063 阅读 · 0 评论 -
Codeforces Round #117 (Div. 2)---D. Common Divisors
Vasya has recently learned at school what a number’s divisor is and decided to determine a string’s divisor. Here is what he came up with.String a is the divisor of string b if and only if there exists原创 2015-03-30 16:59:23 · 1212 阅读 · 0 评论 -
POJ2778---DNA Sequence(AC自动机+矩阵)
Description It’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 segm原创 2015-03-10 21:55:09 · 914 阅读 · 0 评论 -
hdu2609---How many
Problem Description Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say th原创 2015-02-17 22:18:09 · 1306 阅读 · 0 评论 -
ZOJ3430---Detect the Virus
Time Limit: 2 Seconds Memory Limit: 65536 KBOne day, Nobita found that his computer is extremely slow. After several hours’ work, he finally found that it was a virus that made his poor computer s原创 2015-02-10 14:46:01 · 1383 阅读 · 0 评论 -
hdu1238---Substrings
Problem Description 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 g原创 2015-02-17 15:35:00 · 1236 阅读 · 0 评论 -
hdu3294---Girls' research
Problem Description One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps: First step: girls will write a long string (only c原创 2015-02-18 17:18:02 · 1153 阅读 · 0 评论 -
hdu3374---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 “SKYLONG”, we can generate seven strings: String Rank SKYLONG 1 K原创 2015-02-17 19:57:52 · 1045 阅读 · 0 评论 -
SPOJ7758--- Growing Strings
Gene and Gina have a particular kind of farm. Instead of growing animals and vegetables, as it is usually the case in regular farms, they grow strings. A string is a sequence of characters. Strings hav原创 2015-02-06 13:51:45 · 1024 阅读 · 0 评论 -
HDU3695---Computer Virus on Planet Pandora
Computer Virus on Planet PandoraTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 256000/128000 K (Java/Others)Total Submission(s): 2847 Accepted Submission(s): 799Problem Descripti原创 2015-02-04 21:35:12 · 748 阅读 · 0 评论 -
HDU2222---Keywords Search
Keywords SearchTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 38092 Accepted Submission(s): 12269Problem DescriptionIn the moder原创 2015-02-04 20:49:14 · 867 阅读 · 0 评论 -
hdu3068---最长回文
最长回文Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9097 Accepted Submission(s): 3135Problem Description给出一个只由小写英文字符a,b,c...y,z组成原创 2015-02-01 21:38:18 · 799 阅读 · 0 评论 -
hdu4513---吉哥系列故事——完美队形II
Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] … h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的; 2、左右对称,假设有m个人形成新的队形,则第1个人和第原创 2015-02-18 13:43:19 · 984 阅读 · 0 评论 -
Codeforces Round #291 (Div. 2)---C. Watto and Mechanism
Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initially the memory of the mechanism is filled with n strings. Then the原创 2015-02-15 13:34:02 · 1553 阅读 · 0 评论 -
hdu2896---病毒侵袭(AC自动机)
Problem Description 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他决定要把世界上所有带病毒的网站都找出来。当然,谁都知道这是不可能原创 2015-03-02 14:17:32 · 844 阅读 · 0 评论 -
hdu2243---考研路茫茫——单词情结(AC自动机+矩阵+二分)
首先对2^64取模的话,可以直接用unsigned long long,这样溢出部分就是取模后的结果了 方法类似POJ2778传送门 只不过这里要统计长度不超过m的方案 我们先统计出长度为m的所有方案,然后减去不包含这些串的方案,剩下就是至少包含一个串的方案了 设转移矩阵为A 相当于sum = A + A^2 + … A^m f(m) = f(m / 2) * (1 + A原创 2015-03-11 12:42:08 · 1107 阅读 · 0 评论 -
hdu2604---Queuing(AC自动机+矩阵)
Problem Description Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch ti原创 2015-03-10 21:17:54 · 682 阅读 · 0 评论 -
POJ1625---Censored!(AC自动机+dp+高精度)
Description The alphabet of Freeland consists of exactly N letters. Each sentence of Freeland language (also known as Freish) consists of exactly M letters without word breaks. So, there exist exactly原创 2015-03-09 19:40:21 · 1109 阅读 · 0 评论 -
hdu2825---Wireless Password(AC自动机+状压dp)
Wireless Password Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4688 Accepted Submission(s): 1433Problem Description Liyuan lives in a o原创 2015-03-08 11:13:27 · 955 阅读 · 0 评论