Bzoj2780: [Spoj]8093 Sevenk Love Oimaster】的更多相关文章

题目 Oimaster and sevenk love each other. But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster.As a woman's nature, sevenk felt angry and began to check oimaster's online talk with ChuYuXun. Oimaster talked with ChuYuXun n time…
Description Oimaster and sevenk love each other. But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster.As a woman's nature, s evenk felt angry and began to check oimaster's online talk with ChuYuXun.    Oimaster talked with Ch…
0.题意:给定N个原始字符串S,M次查询某个特殊的字符串S'在多少个原始串中出现过. 1.分析:这个题我们第一感觉就是可以用后缀自动机来搞,然后我们发现不是本质不同的字串..求出现过的次数,也就是说多次出现只算一次...然后我们依旧用建立后缀自动机,然后我们观察到询问是可以离线的..然后冷静一下QAQ--好了..询问可以离线后,我们对这个树形结构求一下dfs序,然后我们就可以把树上的询问变成一个序列的区间查询,然后就变成了BZOJ1878HH的项链..具体怎么搞呢?我们可以将询问排序,然后离线的…
题目 传送门 Sol 就是广义\(sam\) 然后记录下每个状态属于哪些串,开\(set\)维护 \(parent\)树上启发式合并一下就好了 # include <bits/stdc++.h> # define RG register # define IL inline # define Fill(a, b) memset(a, b, sizeof(a)) using namespace std; typedef long long ll; IL int Input(){ RG int x…
[BZOJ2780][Spoj]8093 Sevenk Love Oimaster Description Oimaster and sevenk love each other.     But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster.As a woman's nature, sevenk felt angry and began to check oimaster's online t…
目录 题意 思路 AC_Code1 AC_Code2 AC_Code3 参考 @(bzoj 2780: [Spoj]8093 Sevenk Love Oimaster) 题意 链接:here 有\(n\)个大串\(s\)和\(m\)个询问,每次给出一个字符串\(t\)询问在多少个大串中出现过. \(1\le n\le 10000,1\le m\le 60000,\sum|s|\le 100000,\sum |t|\le 360000\) 思路 初步分析 对\(n\)个串建广义后缀自动机(每个串插…
全部串起来做SA, 在按字典序排序的后缀中, 包含每个询问串必定是1段连续的区间, 对每个询问串s二分+RMQ求出包含s的区间. 然后就是求区间的不同的数的个数(经典问题), sort queries + BIT 就行了.时间复杂度O(N log N). 速度垫底了QAQ 你们都会SAM.... ---------------------------------------------------------------------- #include<cmath> #include<c…
JZPGYZ - Sevenk Love Oimaster     Oimaster and sevenk love each other.       But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster. As a woman's nature, sevenk felt angry and began to check oimaster's online talk with ChuYuXun…
LINK:Sevenk Love Oimaster 询问一个模式串在多少个文本串中出现过. 考虑广义SAM 统计这种数量问题一般有三种做法. 一种 暴力bitset 这道题可能可以过? 一种 暴力跳parent 复杂度多乘根号. 一种 线段树合并 乘个log. 最简便的 不容易T的首选第二种方法. const int MAXN=100010<<1; int n,m; int last=1,cnt=1; int vis[MAXN],sum[MAXN]; char a[MAXN]; struct…
Description Oimaster and sevenk love each other. But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster. As a woman's nature, s evenk felt angry and began to check oimaster's online talk with ChuYuXun. Oimaster talked with Ch u…