题意:给出串A和串集合B={B1,B2,...,Bn},求串A的所有不同子串中不是B中任一串的子串的数目. 思路:把A和B中所有字符串依次拼接在一起,然后构造后缀自动机,计算每个状态的R集合元素的最大值r,然后统计那些r≤length(A)的状态.hdu不卡时间卡空间,这是最郁闷的...导致下面的程序只在本地随机数据没发现错误,提交就MLE. #include <bits/stdc++.h> using namespace std; #define X first #define Y seco…
Description Given two strings, you have to tell the length of the Longest Common Substring of them. For example:str1 = bananastr2 = cianaic So the Longest Common Substring is "ana", and the length is 3. Input The input contains several test case…
MZL's Circle Zhou Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description MZL's Circle Zhou is good at solving some counting problems. One day, he comes up with a counting problem:You are given two…
The Dominator of Strings Time Limit: 3000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Problem Description Here you have a set of strings. A dominator is a string of the set dominating all strings else. The string S is dominated…