题意:给你n,m 问你n-m中有多少个数首位等于末位。解题思路:数位DP,从0-n有多少个,这样分开计算,首先把每一位所有可能都枚举出来,然后在一位一位的比对DP解题代码: 1 // File Name: 204a.cpp 2 // Author: darkdream 3 // Created Ti...
分类:
其他好文 时间:
2014-07-25 14:01:21
阅读次数:
236
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:
其他好文 时间:
2014-07-23 15:06:06
阅读次数:
320
Common Substrings
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 7082
Accepted: 2355
Description
A substring of a string T is defined as:
T(i, k)=TiTi+...
分类:
其他好文 时间:
2014-07-22 14:27:08
阅读次数:
314
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:
其他好文 时间:
2014-07-06 13:57:54
阅读次数:
155
题目大意:
问的是m个字符串里,都出现过的子串。子串也可以出现在这个串的逆序串中。
思路分析:
居然wa在全5个 “a” 的数据上。
二分的时候下界不能为0。。
思路大致上是把原串和逆序串全部处理出来,放入str中,然后在每个串中间加一个没有出现过的。
此处注意输入不仅仅是字母。
然后跑一遍后缀数组。
然后用标记计数就好了。
#include
#include ...
分类:
其他好文 时间:
2014-07-06 10:07:36
阅读次数:
202
SPOJ Problem Set (classical)
694. Distinct Substrings
Problem code: DISUBSTR
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of ...
分类:
其他好文 时间:
2014-07-03 16:32:42
阅读次数:
212
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
分类:
其他好文 时间:
2014-07-02 10:03:09
阅读次数:
175
UVA 12718 Dromicpalin Substrings(寻找字符串连续子串的回文)...
分类:
其他好文 时间:
2014-07-02 09:45:05
阅读次数:
214
题目大意:
求串中不同的子串的个数。
思路分析:
子串一定是某一个后缀的前缀。
所以我们把每一个后缀拿出来,分析它有多少个前缀,然后除去它与sa数组中前面那个后缀相同的前缀。
最后也就是 ans = segma (n-sa[i] + height[i])....
#include
#include
#include
#include
#define maxn 1...
分类:
其他好文 时间:
2014-07-02 07:23:21
阅读次数:
182
题目
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 representation of s1 = "great":
great
/...
分类:
其他好文 时间:
2014-06-29 23:16:19
阅读次数:
312