摘要: 首先我们应该是枚举 L个位置上的每个字符来得到最终概率然后AC自动机的作用就是为了判断你枚举的地方是否对应了单词节点,如果对应了,就肯定要不得#include #include #include #include #include using namespace std;const int max_... 阅读全文
posted @ 2014-04-16 23:23 KRisen 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 因为字符集比较大,所以就不能用简单字典树,在字典树里面,用链表进行存储。这个倒是不难,练了下手统计的时候还是有点难搞,因为要算所有的两两比较的次数之和,对分叉处进行计算,注意细节#include #include #include using namespace std;const int N = ... 阅读全文
posted @ 2014-04-16 15:42 KRisen 阅读(234) 评论(0) 推荐(0) 编辑