摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2896题意:中文......思路:这里就知识循环枚举每一个网址即可,set记录每个网址包含的病毒的编号。//#pragma comment(linker,"/STACK:327680000,327680000")#include <iostream>#include <cstdio>#include <cmath>#include <vector>#include <cstring>#include <algorithm&g 阅读全文
posted @ 2013-02-19 19:29 E_star 阅读(206) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2222题意:给出n个单词,再给出一段包含m个字符的文章,求有多少个单词在文章里出现过。思路:才开开始以为简单的Trie数就可以,结果TLE到无语,字典树枚举每一个查找单词的第一个字母的话是O(N*50)前边还有一个T计算的话会超时,看了一下解题报告原来是AC自动机的基础应用。给出一个不错的链接http://blog.himdd.com/?p=2169这里讲的很详细。想不到,回校第一个题目竟然是4个2的题号,无语。。。。//#pragma comment(linker,"/STACK:32768000 阅读全文
posted @ 2013-02-19 15:52 E_star 阅读(295) 评论(0) 推荐(0) 编辑