HDU-1238 Substrings】的更多相关文章

Problem Description You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.   Input The first line of the input…
http://acm.hdu.edu.cn/showproblem.php?pid=1238 Substrings Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1238 Description You are given a number of case-sensitive strings of alphabetic characte…
题目链接:hdu 4455 Substrings 题目大意:给出n,然后是n个数a[1] ~ a[n], 然后是q次询问,每次询问给出w, 将数列a[i]分成若干个连续且元素数量为w的集合,计算每个集合中出现的数字种类,输出总和. 解题思路:一开始想到遍历的算法,保持集合元素为w,每次剔除最前一个,加入一个,移动集合,维护数字种类,这种算法的复杂度为o(n^2), 但是超时了,后来看了下题解,dp[i] = dp[i - 1] + sum[i] - cnt; http://blog.csdn.n…
HDOJ 1238 Substrings [最长公共子串] Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11430 Accepted Submission(s): 5490 Problem Description You are given a number of case-sensitive strings of alphabetic…
题目大意:给你N个串,求出来他们的最大公共子串的长度(子串反过来也算他们的子串).   分析:很久以前就做过这道题,当时是用的strstr做的,不过相同的都是枚举了子串......还是很暴力,希望下次遇到类似的题目我已经掌握高效的方法了. ============================================================================== #include<stdio.h> #include<string.h> ; ; ; c…
Substrings Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3240    Accepted Submission(s): 990 Problem Description XXX has an array of length n. XXX wants to know that, for a given w, what is t…
Substrings Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1161    Accepted Submission(s): 351 Problem Description XXX has an array of length n. XXX wants to know that, for a given w, what is…
Substrings Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1727    Accepted Submission(s): 518 Problem Description XXX has an array of length n. XXX wants to know that, for a given w, what is…
Substrings Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3269    Accepted Submission(s): 999 Problem Description XXX has an array of length n. XXX wants to know that, for a given w, what is t…
XXX has an array of length n. XXX wants to know that, for a given w, what is the sum of the distinct elements' number in all substrings of length w. For example, the array is { 1 1 2 3 4 4 5 } When w = 3, there are five substrings of length 3. They a…