随笔分类 - 字符串-AC自动机
摘要:3439: Kpm的MC密码 Description 背景 想Kpm当年为了防止别人随便进入他的MC,给他的PC设了各种奇怪的密码和验证问题(不要问我他是怎么设的。。。),于是乎,他现在理所当然地忘记了密码,只能来解答那些神奇的身份验证问题了。。。 描述 Kpm当年设下的问题是这样的: 现在定义这么
阅读全文
摘要:3530: [Sdoi2014]数数 Description 我们称一个正整数N是幸运数,当且仅当它的十进制表示中不包含数字串集合S中任意一个元素作为其子串。例如当S=(22,333,0233)时,233是幸运数,2333、20233、3223不是幸运数。 给定N和S,计算不大于N的幸运数个数。 我
阅读全文
摘要:Resource Archiver Time Limit: 10000MS Memory Limit: 100000KB 64bit IO Format: %I64d & %I64u Description Great! Your new software is almost finished! T
阅读全文
摘要:Description Given an N × M matrix, your task is to find the number of occurences of an X × Y pattern. InputThe first line contains a single integer t
阅读全文
摘要:【题意】 某人读论文,一篇论文是由许多单词组成。但他发现一个单词会在论文中出现很多次,现在想知道每个单词分别在论文中出现多少次。 【分析】 个人觉得是用了反fail树的思想,Ans[i]=t[i].cnt+∑Ans[反fail]...不过因为有些节点的反fail会有很多个,存起来不方便。但是AC自动
阅读全文
摘要:【题意】 给定一些单词,我们定义一篇可读文章至少包含一个这样的单词,求长度为M的可读文章总数。 【分析】 用前几题的方法可以求长度为M的不可读的文章总数Sum,所以我们可以用26^M-Sum来求出可读文章的总数。不过这题的N*Len太大,也就是AC自动机的节点太多,如果用矩阵乘法求解用爆空间,所以我
阅读全文
摘要:Lost's revenge Time Limit: 5000MS Memory Limit: 65535KB 64bit IO Format: %I64d & %I64u Description Lost and AekdyCoin are friends. They always play "n
阅读全文
摘要:Wireless Password Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Description Liyuan lives in a old apartment. One day, he sud
阅读全文
摘要:DNA repair Time Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Description Biologists finally invent techniques of repairing DNA t
阅读全文
摘要:DNA Sequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14758 Accepted: 5716 Description It's well known that DNA Sequence is a sequen
阅读全文
摘要:Word Puzzles Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 10782 Accepted: 4076 Special Judge Description Word puzzles are usually simple
阅读全文
摘要:Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10504 Accepted Submission(s): 3701 Problem Descri
阅读全文
摘要:Description 阿狸喜欢收藏各种稀奇古怪的东西,最近他淘到一台老式的打字机。打字机上只有28个按键,分别印有26个小写英文字母和'B'、'P'两个字母。经阿狸研究发现,这个打字机是这样工作的:l 输入小写字母,打字机的一个凹槽中会加入这个字母(这个字母加在凹槽的最后)。l 按一下印有'B'的
阅读全文
摘要:Problem Description In the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature
阅读全文
浙公网安备 33010602011771号