题目链接 链接 翻译 给你一个字符串 \(s_i\) 的生成规则,\(s_{i+1}=s_it_is_i\)。 因为 \(t\) 的长度为 \(n\), 所以一直会生成到第 \(n+1\) 个字符串。 然后给你 \(Q\) 个询问,第 \(i\) 个询问会问你字符串 \(w\) 在 \(s_k\)
转载
2021-02-21 15:23:00
219阅读
2评论
Codeforces 题面传送门 & 洛谷题面传送门 事实证明,有的难度评分不算很高、涉及的知识点不算很难的题目也能出得非常神仙 首先考虑如何暴力求答案。注意到一个文本串 \(T\) 在 \(s_k\) 中出现的位置,有两种可能,要么跨过中间的 \(t_k\),要么没跨过,前者等价于文本串在 \(s ...
转载
2021-10-19 20:49:00
100阅读
2评论
设 \(F(m, s_i)\) 表示字符串 \(m\) 在 \(s_i\) 中出现的个数,再设 \(G(m, s_i)\) 表示 \(s_i\) 中因新增加的字符 \(t_i\) 而新出现的 \(m\) 串个数。那么有简单的转移:\[F(m, s_i) = 2\times F(m, s_{i - 1}) + G(m, s_i)
\]为了把它转换成通项公式,设 \(s_p\) 为 \(m\) 第一次
转载
2021-03-10 18:49:52
176阅读
2评论
Screeching tires. Searching lights. Wailing sirens. Police cars everywhere. Tr
原创
2022-11-10 08:09:38
64阅读
On April 7, 2017, residents in Dallas, Texas, woke to the sound of emergency sirens blaring all over the city. No one could shut them off, and after r
转载
2017-09-06 08:37:00
220阅读
uva 590 Always on the runScreeching tires. Searching lights. Wailing sirens. Police cars everywhere. Trisha Quickfinger did it again! Stealing the `Mona Lisa’ had been more difficult than planned, but
原创
2023-07-26 16:55:57
39阅读