地址: 题目: NSUBSTR - Substrings no tags no tags You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the ...
分类:
其他好文 时间:
2017-09-14 16:35:28
阅读次数:
260
题目大意: 给你一个字符串s,求出不同长度出现次数最多的字串的最大出现次数。 思路: 先对s构造后缀自动机,然后把s放进去匹配,每一个经过的结点表示一种长度的子串,用一个cnt记录能以每个状态表示的子串数量,然后按拓扑序DP。 注意拓扑序并不等同于在SAM中插入的次序,因为用new_q替代q的操作会 ...
分类:
其他好文 时间:
2017-09-14 10:28:14
阅读次数:
147
DISUBSTR - Distinct Substrings no tags no tags Given a string, we need to find the total number of its distinct substrings. Input T- number of test ca ...
分类:
编程语言 时间:
2017-09-10 01:15:00
阅读次数:
176
1 #include 2 #include 3 #include 4 using namespace std; 5 int sz=0,la,rt; 6 int ch[500010][26],l[500010],fa[500010]; 7 void Extend(int c){ 8 int end=+... ...
分类:
其他好文 时间:
2017-08-30 13:03:49
阅读次数:
168
Given a string s, cut s into some substrings such that every substring is a palindrome. Return the minimum cuts needed for a palindrome partitioning o ...
分类:
其他好文 时间:
2017-08-26 12:46:40
阅读次数:
226
Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are co... ...
分类:
其他好文 时间:
2017-08-13 22:13:45
阅读次数:
594
一般遇到多串问题,就用不同的符号把他们接起来,当成一个串来处理。 如A串是"aaaba",B串是“abaa"。 把height数组按照不小于K分组,假设K = 2。从前向后扫描,对于每一组中的每个B,考虑前面A对其的贡献。 可以用栈来维护A的值。当要入栈的height值大于栈顶的值,统计得到的子串的 ...
分类:
编程语言 时间:
2017-08-11 22:59:22
阅读次数:
134
SPOJ Problem Set (classical) 694. Distinct Substrings Problem code: DISUBSTR Given a string, we need to find the total number of its distinct substrin ...
分类:
其他好文 时间:
2017-08-06 12:39:49
阅读次数:
182
Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c ...
分类:
其他好文 时间:
2017-07-26 09:42:57
阅读次数:
114
Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c ...
分类:
其他好文 时间:
2017-07-24 16:23:08
阅读次数:
155