随笔分类 -  ACM-字符串

摘要:题面 This is the hard version of the problem. The difference is the constraint on the sum of lengths of strings and the number of test cases. You can ma 阅读全文
posted @ 2020-03-20 16:12 Artoriax 阅读(267) 评论(0) 推荐(0)
摘要:Description You are given a string S consisting of only lowercase english letters and some queries. For each query (l,r,k), please output the starting 阅读全文
posted @ 2019-09-03 14:26 Artoriax 阅读(133) 评论(0) 推荐(0)
摘要:KMP算法 介绍 用处:用于串的模式匹配,即找出模式串在主串中的出现位置 朴素想法,直接遍历两个串,失配回到主串开始比较位置的下一位继续匹配,复杂度$O(nm)$ KMP算法即在$O(n+m)$复杂度内匹配的算法 算法实现 通过一个叫$next$数组的东西,使指向主串的$i$指针不回溯,只改变指向模 阅读全文
posted @ 2019-04-10 15:43 Artoriax 阅读(205) 评论(0) 推荐(0)