摘要: 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 阅读全文
posted @ 2016-07-12 15:35 konjak魔芋 阅读(612) 评论(1) 推荐(0) 编辑
摘要: 【题意】 某人读论文,一篇论文是由许多单词组成。但他发现一个单词会在论文中出现很多次,现在想知道每个单词分别在论文中出现多少次。 【分析】 个人觉得是用了反fail树的思想,Ans[i]=t[i].cnt+∑Ans[反fail]...不过因为有些节点的反fail会有很多个,存起来不方便。但是AC自动 阅读全文
posted @ 2016-07-12 10:09 konjak魔芋 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 【题意】 给定一些单词,我们定义一篇可读文章至少包含一个这样的单词,求长度为M的可读文章总数。 【分析】 用前几题的方法可以求长度为M的不可读的文章总数Sum,所以我们可以用26^M-Sum来求出可读文章的总数。不过这题的N*Len太大,也就是AC自动机的节点太多,如果用矩阵乘法求解用爆空间,所以我 阅读全文
posted @ 2016-07-12 10:08 konjak魔芋 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Lost's revenge Time Limit: 5000MS Memory Limit: 65535KB 64bit IO Format: %I64d & %I64u Description Lost and AekdyCoin are friends. They always play "n 阅读全文
posted @ 2016-07-12 09:39 konjak魔芋 阅读(653) 评论(0) 推荐(0) 编辑