摘要: Musical Theme POJ - 1743 题意:求一段旋律的最长主旋律(不可重叠)。 对给出的旋律做差,求后缀数组。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 阅读全文
posted @ 2017-09-14 17:08 yijiull 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Long Long Message POJ - 2774 题意:求两个串的最长公共字串。 用特殊符号连接两个字符串,后缀数组。 枚举height,如果sa[i]和sa[i-1]分别属于不同的串,则更新最大值。 1 #include <iostream> 2 #include <cstdio> 3 # 阅读全文
posted @ 2017-09-14 14:04 yijiull 阅读(225) 评论(0) 推荐(0) 编辑