2462: [BeiJing2011] Matrix template time limit:2 Sec Memory limit:128 MB
submit:915 solved:432
[Submit] [Status] [Discuss] Description
Given a 01 matrix of M row n columns, and the 01 matrix of the Q rows B column, you need to ask the Q matrix which
Appears in the original matrix.
The so-called 01 matrix is that all elements in the matrix are either 0 or 1.
Input
Enter the first behavior of the file M, N, A, B, see the title description.
The next m line, n characters per line, not 0 or 1, describes the original matrix.
The next line is the number of queries you want to process.
The next Q Matrix, a total of q*a lines, b characters per line, describes the Q 01 matrix.
Output
You need to output Q line, each behavior 0 or 1, indicating whether the matrix has occurred, 0 means that it has not appeared, 1 table
Show.
Sample Input3 3 2 2
111
000
111
3
11
00
11
11
00
OneSample Output1
0
1
HINT
For 100% of data, A < = 100.
Source
Day4
[Submit] [Status] [Discuss]
Two-dimensional hash, the number can be queried.
1 #include <bits/stdc++.h>2 signed main (void)3{4 for (int; i--;) Puts ("1"); 5 }
@Author: Yousiki
Bzoj 2462: [BeiJing2011] Matrix template