随笔分类 - ACM-RMQ-ST
摘要:http://poj.org/problem?id=3693 整体思路就是枚举长度L,看长度为L的字符串在s中连续出现了几次。 既然长度为L的串是重复出现的,那么s[0]…s[L]…s[2*L]…中相邻的两个一定出现在重复的L串中。(并不一定在首尾位置,也可能出现在中间)。 那么我们求i*L和(i+
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4691 留个板子。
阅读全文
摘要:A.Abandoned country 构建最小生成树,然后每条边的权值乘以两边的点数之积。 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <vector> using n
阅读全文