#P10474. [ICPC 2011 Beijing R] Matrix 矩阵哈希
[ICPC 2011 Beijing R] Matrix 矩阵哈希
Problem Description
Given an -row -column matrix, and matrices of size rows and columns, you need to determine which of these matrices appear in the original matrix.
A matrix means that every element in the matrix is either or .
Input Format
The first line of the input file contains , as described above.
The next lines each contain characters, each being either or , describing the original matrix.
The next line contains the number of queries .
Then follow matrices, totaling lines, where each line contains characters, describing the matrices.
Output Format
Output lines. Each line should be or , indicating whether the corresponding matrix appears in the original matrix: means it does not appear, and means it does.
3 3 2 2
111
000
111
3
11
00
11
11
00
11
1
0
1
Hint
For of the actual testdata, , and .
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5