Bzoj 2462: [BeiJing2011] Matrix template

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.