摘要:
Problem Description Now you are back,and have a task to do:Given you a string s consist of lower-case English letters only,denote f(s) as the number o 阅读全文
摘要:
Problem Description Given a string S. K-string is the sub-string of S and it appear in the S at least K times.It means there are at least K different 阅读全文
摘要:
Description A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, al 阅读全文
摘要:
代码 //确认maxn大小,一般是原字符串长度最大值的2倍,然后是init(),最后是一个一个的字符插入, //转化成对应的数字,调用Insert函数,可支持在线。 struct SAM { int ch[maxn][26]; int pre[maxn],step[maxn]; int last,i 阅读全文
摘要:
代码 //首先init,传进去的参数分别是两边的点的个数,然后调用solve,如果是求 //最小值,改为负数,相当于的求负数的最大值。 struct KM { int W[maxn][maxn],n,m; int Lx[maxn],Ly[maxn]; int To[maxn]; bool S[max 阅读全文
摘要:
Problem Description A group of thieves is approaching a museum in the country of zjsxzy,now they are in city A,and the museum is in city B,where keeps 阅读全文