![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
暴力
柒月 流火
菜
展开
-
POJ - 3080 Blue Jeans 字符串 暴力求最长公共连续子序列
POJ - 3080 Blue Jeans 题意: 给定一些字符串求最长公共连续子序列(子序列长度必须大于3),符合条件就输出这个连续子序列(如果存在多个长度相同的连续子序列就输出字典序最小的那个),否则就输出 no significant commonalities 思路: 按字符串长度从大到小暴力枚举第一个字符串的所有大于3的连续子序列,并检查其他字符串中是否含有这段连续子序列 ...原创 2019-01-17 19:30:38 · 146 阅读 · 0 评论 -
HDU - 1238 Substrings 求最长连续子序列(可以为逆序)
HDU - 1238 Substrings 题意: 求所有字符串中的相同连续子序列长度,可以是逆序 2 rose orchid 结果为 2 ,第一个字符串中含有 ro ,第二个含有 or(ro的逆序) 思路: 找出最短的字符串,然后枚举 用到了几个函数 strncpy strstr strrev strcpy #include<iostr...原创 2019-01-24 20:21:54 · 162 阅读 · 0 评论 -
HDU - 2328 Corporate Identity 暴力 || KMP 求最长公共子序列
HDU - 2328 Corporate Identity 题意: 求所有字符串中的最长公共连续子序列 思路: 暴力:找出最短字符串,枚举所有长度 #include<iostream> #include<cstdio> #include<cstring> using namespace std; char s[4010][210]; char a[2...原创 2019-01-25 21:23:02 · 235 阅读 · 0 评论