码迷,mamicode.com
首页 >  
搜索关键字:poj1226 substrings    ( 386个结果
codefroces451D - Count Good Substrings 数位DP
题意:给你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
【leetcode刷题笔记】Scramble String
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
poj Common Substrings(后缀数组&单调队列)
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
leetcode--Scramble String
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
POJ 1226 Substrings (后缀数组)
题目大意: 问的是m个字符串里,都出现过的子串。子串也可以出现在这个串的逆序串中。 思路分析: 居然wa在全5个 “a” 的数据上。 二分的时候下界不能为0。。 思路大致上是把原串和逆序串全部处理出来,放入str中,然后在每个串中间加一个没有出现过的。 此处注意输入不仅仅是字母。 然后跑一遍后缀数组。 然后用标记计数就好了。 #include #include ...
分类:其他好文   时间:2014-07-06 10:07:36    阅读次数:202
spoj 694 求一个字符串中不同子串的个数
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
[leetcode] Scramble String
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(寻找字符串连续子串的回文)
UVA 12718 Dromicpalin Substrings(寻找字符串连续子串的回文)...
分类:其他好文   时间:2014-07-02 09:45:05    阅读次数:214
SPOJ 694、705 Distinct Substrings 、 New Distinct Substrings (后缀数组)
题目大意: 求串中不同的子串的个数。 思路分析: 子串一定是某一个后缀的前缀。 所以我们把每一个后缀拿出来,分析它有多少个前缀,然后除去它与sa数组中前面那个后缀相同的前缀。 最后也就是 ans = segma (n-sa[i] + height[i]).... #include #include #include #include #define maxn 1...
分类:其他好文   时间:2014-07-02 07:23:21    阅读次数:182
Scramble String
题目 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
386条   上一页 1 ... 36 37 38 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!