题意: 给出最多10个长度不超过100000的字符串,求他们的LCS的长度。时限是鬼畜的0.25s 。后缀自动机练习...虽然有人这么说但我并不觉得hash能过。本题可以说是【论SAM中按step排序更新pre的重要性】: 总的来说做法和1811-LCS有点类似,不同的是因为有多个字符串,因此每.....
分类:
其他好文 时间:
2015-01-11 16:05:37
阅读次数:
232
题意: 一个长度不超过250000的字符串,求出它长度为i的子串最多出现了多少次。 后缀自动机练习题...虽说是用Cube评测的不过时限仍然鬼畜。考虑SAM的性质: 一个串的SAM肯定可以接受这个串的所有子串。SAM上的每一个点代表了一个子串。 主链:SAM上最长的那条链,也就是说从根走...
分类:
其他好文 时间:
2015-01-11 15:59:35
阅读次数:
249
Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
分类:
其他好文 时间:
2015-01-11 14:46:32
阅读次数:
160
Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.每次把中间元素当成根节...
分类:
其他好文 时间:
2015-01-11 12:10:19
阅读次数:
137
Lexicographical Substring SearchTime Limit: 1000MSMemory Limit: Unknown64bit IO Format: %lld & %lluDescriptionLittle Daniel loves to play with strings...
分类:
其他好文 时间:
2015-01-10 22:14:19
阅读次数:
301
8222. SubstringsProblem code: NSUBSTRYou are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal ...
分类:
其他好文 时间:
2015-01-10 20:57:29
阅读次数:
263
Problem 1 [Balanced Binary Tree]Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as ...
分类:
其他好文 时间:
2015-01-10 06:36:11
阅读次数:
290
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
分类:
其他好文 时间:
2015-01-09 22:29:55
阅读次数:
181
1812. Longest Common Substring IIProblem code: LCS2A string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the s...
分类:
其他好文 时间:
2015-01-09 22:06:32
阅读次数:
339