随笔分类 -  字符串

hdu 1277 AC自动机
摘要:全文检索Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1134Accepted Submission(s): 357Problem Description我们大家经常用google检索信息,但是检索信息的程序是很困难编写的;现在请你编写一个简单的全文检索程序。问题的描述是这样的:给定一个信息流文件,信息完全有数字组成,数字个数不超过60000个,但也不少于60个;再给定一个关键字集合,其中关键字个数不超过10000个,每个关键字的信息数字不超 阅读全文

posted @ 2014-04-08 16:43 雄.. 阅读(255) 评论(0) 推荐(0)

hdu 4300 kmp算法扩展
摘要:Clairewd’s messageTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2929Accepted Submission(s): 1132Problem DescriptionClairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messages and she was preparing 阅读全文

posted @ 2014-03-28 21:31 雄.. 阅读(162) 评论(0) 推荐(0)

hdu 3613 KMP算法扩展
摘要:Best RewardTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 500Accepted Submission(s): 201Problem DescriptionAfter an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great ex 阅读全文

posted @ 2014-03-27 18:09 雄.. 阅读(381) 评论(0) 推荐(0)

HDU 2594 kmp算法变形
摘要:Simpsons’ Hidden TalentsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2456Accepted Submission(s): 929Problem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: 阅读全文

posted @ 2014-03-27 16:49 雄.. 阅读(211) 评论(0) 推荐(0)

hdu 1686 KMP算法
摘要:OulipoTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4064Accepted Submission(s): 1611Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo gr 阅读全文

posted @ 2014-03-27 15:47 雄.. 阅读(212) 评论(0) 推荐(0)

uva 11468 AC自动机+概率DP
摘要:#include#include#include#include#include#includeusing namespace std;const int SIGMA_SIZE = 64;const int MAXNODE = 500; // 结点总数const int MAXS = 20 + 10; // 模板个数int idx[256], n;double prob[SIGMA_SIZE];struct AhoCorasickAutomata { int ch[MAXNODE][SIGMA_SIZE]; int f[MAXNODE]; // fail函数 int m... 阅读全文

posted @ 2014-03-27 14:45 雄.. 阅读(185) 评论(0) 推荐(0)

La 4670 AC自动机(模版)
摘要:#include#include#include#include#include#includeusing namespace std;const int SIGMA_SIZE = 26;const int MAXNODE = 11000;const int MAXS = 150 + 10;map ms;struct AhoCorasickAutomata{ int ch[MAXNODE][SIGMA_SIZE]; int f[MAXNODE]; // fail函数 int val[MAXNODE]; // 每个字符串的结尾结点都有一个非0的val int la... 阅读全文

posted @ 2014-03-27 14:04 雄.. 阅读(187) 评论(0) 推荐(0)

La 3942 字符串+dp
摘要:题目大意:一个字符串,可以分解成若干英语单词的连接(单词可以重复使用),求有多少种方法?#include#include#include#includeusing namespace std;const int maxl=300005;const int maxwn=4005;const int maxwl=105;const int MOD=20071027;const int maxnode=400005;const int sigma_size=26;struct Trie{ int ch[maxnode][sigma_size]; int val[maxnode]; ... 阅读全文

posted @ 2014-03-18 20:54 雄.. 阅读(137) 评论(0) 推荐(0)

导航