Codeforces 754E:Dasha and cyclic table

Posted barriery

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces 754E:Dasha and cyclic table相关的知识,希望对你有一定的参考价值。

Codeforces 754E:Dasha and cyclic table

题目链接:http://codeforces.com/problemset/problem/754/E

题目大意:$A$矩阵($size(A)=n \times m$,仅含‘a‘-‘z‘)在整个平面做周期延拓,问$B$矩阵($size(B)=r \times c$,包含‘a‘-‘z‘及‘?‘,‘?‘为通配符)在哪些位置能与$A$矩阵匹配。输出$n \times m$的01矩阵,1表示在该位置匹配.

枚举+bitset常数优化

直接暴力的话复杂度为$O(n^4)(n=400)$,而bitset做位运算复杂度为$O(\frac{n}{32})$,若能用bitset优化,则可将$O(n^4)$优化为$O(\frac{n^4}{32})$.

假定$B$矩阵可以匹配$A$矩阵的每一位,令输出矩阵$ans$每个元素都为$1$.

 

睡觉(~﹃~)~zZ...

以上是关于Codeforces 754E:Dasha and cyclic table的主要内容,如果未能解决你的问题,请参考以下文章

Dasha and Photos CodeForces - 761F (前缀优化)

codeforces 1100D-Dasha and Chess

Cow and Snacks(吃点心--图论转换) Codeforces Round #584 - Dasha Code Championship - Elimination Round (rate

Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div.

CodeForces 621AWet Shark and Odd and Even

codeforces 621A Wet Shark and Odd and Even