KMP
文章平均质量分 69
KMP
睡醒继续做梦
和其光 同其尘
展开
-
洛谷:P4824 [USACO15FEB]Censoring S--KMP
题目描述 原题来自:USACO 2015 Feb. Silver 给出两个字符串A和B ,每次从前往后找到A的一个子串B并将其删除,空缺位依次向前补齐,重复上述操作多次,直到A串中不含B串。输出最终的A串。 输入格式 第一行包含一个字符串,第二行包含一个字符串。 输出格式 输出处理后的A串。 输入 whatthemomooofun moo 输出 whatthefun 题意:给定串a,串b, 把a中所有的b删除,最后输出a串(删除一次后,后面的向前补齐) 题解:...原创 2021-07-20 15:39:52 · 213 阅读 · 0 评论 -
HDU - 2328 Corporate Identity 暴力枚举+kmp
Corporate Identity 题意:在多个母串中找到字典序最小的最长公共字串 题解:暴力枚举s[0]的所有字串,然后利用kmp去匹配其他串,找到最长且字典序最小的即可。 由于习惯把next数组开大了,导致超时好多次。。。 #include<iostream> #include<algorithm> #include<cstring> #include<set> using namespace std; const int N=1e6+10; i原创 2021-07-20 09:44:33 · 120 阅读 · 0 评论 -
How many HDU - 2609
来源:How many HDU - 2609 Problem Description Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell meHow many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two necklaces are some).Fo原创 2021-07-22 16:31:06 · 82 阅读 · 0 评论