
字符串
文章平均质量分 80
EIKY
这个作者很懒,什么都没留下…
展开
-
POJ---3461-Oulipo(KMP)
A - OulipoTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionThe French author Georges Perec (1936–1982) once wrote a book, La di原创 2015-08-13 10:42:10 · 447 阅读 · 0 评论 -
HDU-5769-Substring(后缀数组)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5769题意:给定字符串str ('a'-'z')和字符c,问str中包含c的不重复字串有多少。题解:CODE:#include using namespace std;#define bug cout<<"bug"<<endl#define INF 0x3f3f3f3原创 2016-08-01 15:36:52 · 321 阅读 · 0 评论 -
HDU-The All-purpose Zero(LIS)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5773题意:给出整数组a,0题解:0可以转化成任意整数,包括负数,显然求LIS时尽量把0都放进去必定是正确的。因此我们可以把0拿出来,对剩下的做O(nlogn)的LIS,统计结果的时候再算上0的数量。为了保证严格递增,我们可以将每个权值S[i]减去i前面0的个数,再做LIS,就能保证结果是严格递增的原创 2016-07-30 12:54:45 · 210 阅读 · 0 评论 -
HDU-5763-Another Meaning(KMP+DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5763题意:给出字符串a,b,其中,字符串b代表两种含义,问a最多有多少种含义。题解:kmp找出b在a中对应的位置,根据位置关系dp令dp[i]表示到i结尾的字符串可以表示的不同含义数,那么考虑两种转移:末尾不替换含义:dp[i - 1]末尾替换含义:dp[i - |B|原创 2016-07-29 11:00:04 · 290 阅读 · 0 评论 -
POJ-1743-Musical Theme(后缀数组+二分)
Sample Input3025 27 30 34 39 45 52 60 69 79 69 60 52 45 39 34 30 26 22 1882 78 74 70 66 67 64 60 65 800Sample Output5大致题意:求不可重叠最长重复子串 参考 国家集训队论文:算法合集之《后缀数组——处理字符串的有力工具》 先二分答案,原创 2016-04-05 21:33:33 · 304 阅读 · 0 评论 -
HDU---2222-Keywords Search(AC自动机)
G - Keywords SearchCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64u SubmitStatus DescriptionIn the modern tim原创 2015-11-06 17:58:58 · 406 阅读 · 0 评论 -
POJ-3167- Cow Patterns(KMP)
Cow PatternsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 4184 Accepted: 1496Sample Input9 6 1056210107329144321Sample Output1原创 2016-03-29 14:26:16 · 898 阅读 · 0 评论 -
POJ-2774-Long Long Message(后缀数组)
InputTwo strings with lowercase letters on two of the input lines individually. Number of characters in each one will never exceed 100000.OutputA single line with a single integer number – w原创 2016-04-05 15:40:51 · 446 阅读 · 0 评论 -
HDU---4333-Revolving Digits(扩展KMP)
C - Revolving DigitsCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionOne day Silence is原创 2015-11-07 13:30:20 · 334 阅读 · 0 评论 -
HDU---4513-吉哥系列故事――完美队形II (manacher)
B - 吉哥系列故事――完美队形IICrawling in process...Crawling failedTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatus Description 吉哥又想出了一个新的完美队形游戏!原创 2015-11-05 21:14:46 · 370 阅读 · 0 评论 -
POJ-3415-Common Substrings(后缀数组+单调栈)
链接:http://poj.org/problem?id=3415求两串中长度大于k的公共子串有多少个。公共子串可以通过height求,中间分隔连接两串,将height[i]>=k进行分组,对于一组内的height[i],且sa[i]属于a串,需要找到ji]-k),采用单调栈维护一个栈顶最小的height[i],大于栈顶压入,小于更新。每次针对a/b串找前面的b/a串,跑两原创 2017-05-04 16:16:58 · 606 阅读 · 0 评论