2014年7月27日
摘要: 题目来源:http://acm.hdu.edu.cn/showproblem.php?pid=1711 改进的模式匹配算法--KMP算法,时间复杂度有O(n*m)降到O(n+m),求解next数组之后与常规的模式匹配算法相同。 1 #include 2 const int maxn=100... 阅读全文
posted @ 2014-07-27 20:08 BMESwimming 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题目来源:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1549 并查集,求出每个friends集合,然后再计算每个集合friends个数,求出最... 阅读全文
posted @ 2014-07-27 13:04 BMESwimming 阅读(143) 评论(0) 推荐(0) 编辑