题解:对于标准作文库建广义sam 预处理出查询串每个位置往前能匹配的最远位置 二分答案L 然后设dp方程为
$$ dp[i]=max(dp[i-1],max(i-j+dp[j])\left ( i-L\geq j\geqslant i-num[i] \right )) $$
然后我们用单调队列来维护$ dp[i]-i $的最大值
#include #include #include #include #include #include #include #include #include #include
2806: [Ctsc2012]Cheat
Time Limit: 20 Sec Memory Limit: 256 MBSubmit: 1877 Solved: 973[][][] Description
Input
第一行两个整数N,M表示待检查的作文数量,和小强的标准作文库
的行数
接下来M行的01串,表示标准作文库
接下来N行的01串,表示N篇作文
Output
Sample Input
1 2 10110 000001110 1011001100 Sample Output
HINT
输入文件不超过1100000字节
注意:题目有改动,可识别的长度不小于90%即可,而不是大于90%