摘要:
链接:https://codeforces.com/contest/1200/problem/E 题意:依次合并两个单词,每次合并将删去最长相同前后缀,输出结果。 思路:用kmp跑出每个需要被连接的单词的next数组,与之前的单词进行匹配,跑出最长前后缀的长度并更新结果。 1 #include<bi 阅读全文
posted @ 2020-02-03 13:32
古比
阅读(823)
评论(0)
推荐(0)
摘要:
https://www.luogu.com.cn/problemnew/solution/P3375 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e6+10; 4 int kmp[maxn]; 5 char a 阅读全文
posted @ 2020-02-03 10:38
古比
阅读(117)
评论(0)
推荐(0)

浙公网安备 33010602011771号