Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th ...
分类:
其他好文 时间:
2017-12-27 19:40:46
阅读次数:
98
题目: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible represen ...
分类:
编程语言 时间:
2017-12-15 21:35:06
阅读次数:
216
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-12-15 13:29:21
阅读次数:
126
The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For e ...
分类:
编程语言 时间:
2017-12-10 15:16:36
阅读次数:
177
Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one strin ...
分类:
编程语言 时间:
2017-12-10 11:17:03
阅读次数:
176
题链: http://www.spoj.com/problems/NSUBSTR/ 题解: 后缀自动机的水好深啊!懂不了相关证明,带着结论把这个题做了。看来这滩深水要以后再来了。 本题要用到一个叫 Right[P] 的数组,表示 P对应的子串在原串中出现的所有位置的末尾位置下标的集合。本题中,用这个... ...
分类:
其他好文 时间:
2017-12-05 18:46:06
阅读次数:
136
题意 : 对于给出的串,输出其不同长度的子串的种类数 分析 : 有一个事实就是每一个子串必定是某一个后缀的前缀,换句话说就是每一个后缀的的每一个前缀都代表着一个子串,那么如何在这么多子串or后缀的前缀中找出不同的并计数呢?思路就是所有的可能子串数 - 重复的子串数。首先我们容易得到一个长度为 len ...
分类:
编程语言 时间:
2017-11-21 01:13:13
阅读次数:
261
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th ...
分类:
其他好文 时间:
2017-11-17 17:01:49
阅读次数:
132
Problem Statement We have a string s consisting of lowercase English letters. Snuke is partitioning s into some number of non-empty substrings. Let th ...
分类:
其他好文 时间:
2017-11-03 22:03:57
阅读次数:
273
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th ...
分类:
其他好文 时间:
2017-10-24 11:33:52
阅读次数:
128