题目 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…
题目 传送门 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…
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…
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…
AC自动机比较简单,把询问串做成AC自动机然后模板串边跑变更新即可 SAM是把模板串做成广义SAM,然后每个节点存有几个模板串经过,具体方法是每次更新暴力向上跳直到有时间戳我不会证为什么时间复杂度是对的,沿途更新个数,查询的时候直接匹配到最后的点然后输出个数即可 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=400005; int n,m,fa…
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 talk with ChuYuXun. Oimaster talked with Ch…
题意 题目链接 Sol 广义后缀自动机板子题..和BZOJ串那个题很像 首先建出询问串的SAM,然后统计一下每个节点被多少个串包含 最后直接拿询问串上去跑就行了 #include<bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 10; int N, Q; string s[MAXN], t[MAXN]; int fa[MAXN], len[MAXN], ch[MAXN][26], tim[MAXN], val[MAXN],…