![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
文章平均质量分 75
saucyJack
外科
展开
-
poj 2406 Power Strings(KMP || 暴力)
题目链接:http://poj.org/problem?id=2406没想到这道题暴力都能过,而且只有188ms。。。①kmp:②暴力(188ms):#include#include#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=1000010原创 2016-02-09 21:37:29 · 229 阅读 · 0 评论 -
poj 3096 Surprising Strings
题目链接:http://poj.org/problem?id=3096暴力遍历所有字符串,数据比较小,0ms过。#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=105;char s[maxn];bool ok(){ int len=strlen(s);原创 2016-02-05 09:58:17 · 168 阅读 · 0 评论 -
POJ 3080 (字符串匹配)
题目链接:http://poj.org/problem?id=3080题意:给出n个字符串,找出其最长公共子串,若子串长度>3,则输出最长公共子串,否则输出...本来以为要用到kmp或者后缀数组什么的,思考了很久没有思路,看了一下discuss,发现可以暴力过,而且0ms,也是醉了...#include#include#include#include#include#incl原创 2016-01-25 23:57:38 · 308 阅读 · 0 评论 -
POJ 1936(字符串匹配)
题目链接:http://poj.org/problem?id=1936#include#include#include#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=100010;char s[maxn],t[maxn];int main(){#if原创 2016-01-25 22:58:42 · 430 阅读 · 0 评论 -
POJ 1035(字符串模拟)
题目链接:http://poj.org/problem?id=1035题意:给出一个字典,然后给出一些单词,问能否通过一下变换在字典中找到该单词:①替换一个字符②删除一个字符③插入一个字符若该单词已在字典中,则不需要变化。若无法通过变换找到该单词,则不需要输出。思路:模拟吧,数据不是很大,但是一定要想清楚再去写代码,模拟题是硬伤。#include#includ原创 2016-01-25 14:49:33 · 515 阅读 · 0 评论