手动转田神的大作:http://blog.csdn.net/tc_to_top/article/details/38793973 D. Prefixes and Suffixes time limit per test 1:second memory limit per test: 256 megabytes input: standard input output: standard output You have a string s = s1s2...s|s|, where |s| is…
Codeforces79C 题意: 求s串的最大子串不包含任意b串: 思路: dp[i]为以i为起点的子串的最长延长距离. 我们可以想到一种情况就是这个 i 是某个子串的起点,子串的长度-1就是最短, 或者这个 前面的长度 +这个i 就是答案. 所以预处理一下,以 i 为起点的最短子串距离就好了,这里利用KMP比较方便. #include <bits/stdc++.h> using namespace std; typedef long long LL; const int INF=0x3f3…