当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3600:Subimage Recognition

题目描述

An image A is said to be a subimage of another image B if it is possible to remove some rows and/or columns of pixels from B so that the resulting image is identical to A. Figure 6 illustrates an example. Image A, shown in Figure 6(a), is a subimage of image B, shown in Figure 6(b), because the image resulting from the removal of the middle row and column of pixels from B is identical to A.

  
  
   
   
   
(a) Image A(b) Image B

Figure 6: An example of a subimage

Given two black-and-white images A and B, determine whether A is a subimage of B.

输入解释

The input contains a single test case. The first line contains two integers r and c (1 ≤ r, c ≤ 20), the dimensions of A. The following r lines, each containing a string of length c, give an r × c 0-1 matrix representing the pixels of A. The next line contains two integers R and C (rR ≤ 20; cC ≤ 20), the dimensions of B. The following R lines, each containing a string of length C, give an R × C 0-1 matrix representing the pixels of B. A 0 indicates a white pixel; a 1 indicates a black pixel.

输出解释

If A is a subimage of B, print “Yes”; otherwise, print “No”.

输入样例
2 2
11
10
3 3
101
000
100
输出样例
Yes

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3600

最后修改于 2020-10-29T07:05:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 131072