problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03804
u033606236
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int,input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\nprint(a,b)\nflag = 0\nfor i in range(n-m+1):\n for j in range(n-m+1):\n if a[i][j:j+m] == b[0] and a[i+1][j:j+m] == b[1]:\n flag = 1\nprint("Yes" if flag == 1 else "No")', 'n, m = map(int,input().sp...
['Runtime Error', 'Accepted']
['s435434839', 's867040054']
[3064.0, 3064.0]
[18.0, 24.0]
[280, 361]
p03804
u037430802
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['\nimport sys\nn,m = map(int, input().split())\na = []\nb = []\nfor i in range(n):\n a.append(list(input()))\n \nfor i in range(m):\n b.append(list(input()))\n\n\n#\nprint(a)\nprint(b)\n \n \nfor i in range(n-m+1):\n for j in range(n-m+1):\n flag = True\n for x in range(m):\n for y in range(m):\n ...
['Wrong Answer', 'Accepted']
['s182736875', 's768524603']
[3064.0, 3064.0]
[18.0, 18.0]
[479, 458]
p03804
u044964932
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import numpy as np\n\n\ndef main():\n n, m = map(int, input().split())\n As = [list(input()) for _ in range(n)]\n Bs = [list(input()) for _ in range(m)]\n\n As_arr = np.array(As)\n Bs_arr = np.array(Bs)\n ans = 0\n for i in range(n-m+1):\n for j in range(n-m+1):\n xs, xe = i, i+...
['Wrong Answer', 'Accepted']
['s006443478', 's083034039']
[12172.0, 21220.0]
[181.0, 303.0]
[470, 486]
p03804
u055687574
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\n\nA = [input() for n in range(N)]\nB = [input() for m in range(M)]\n\nans = "Yes"\nfor a in A:\n for b in B:\n print(a, b)\n if b not in a:\n ans = "No"\nprint(ans)\n', 'N, M = map(int, input().split())\n\nA = [input() for n in range(N)]\nB = [input() for ...
['Wrong Answer', 'Accepted']
['s298139734', 's211770448']
[3188.0, 2940.0]
[20.0, 19.0]
[216, 196]
p03804
u062484507
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\nA = [input() for i in range(N)]\nB = [input() for j in range(M)]\n\nans = True\nfor k in range(len(B)):\n print(B[k])\n print(A[k])\n if B[k] not in A[k]:\n ans = False\n break\nprint("Yes" if ans == True else "No")', 'N, M = map(int, input().split())\nA = [inp...
['Wrong Answer', 'Accepted']
['s479135431', 's933953125']
[3060.0, 3060.0]
[18.0, 18.0]
[261, 230]
p03804
u063073794
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["yandy\nN, M = map(int, input().split())\nA = [''] * N\nB = [''] * M\n\nfor i in range(N):\n A[i] = input()\nfor j in range(M):\n B[j] = input()\n\nfor i in range(N-M+1):\n for j in range(N-M+1):\n NO = False\n for x in range(M):\n a = A[i+x][j:j+M]\n if a != B[x]:\n ...
['Runtime Error', 'Accepted']
['s089599141', 's851945662']
[3064.0, 3060.0]
[17.0, 22.0]
[419, 303]
p03804
u072717685
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int,input().split())\na = [None]*n\nb = [None]*m\nfor i in range(n):\n a[i] = input()\nfor j in range(m):\n b[j] = input()\nr = 'No'\nfor i in range(n - m):\n end_yoko = i + m + 1\n a_t = [s[i:end_yoko] for s in a]\n for j in range(n - m):\n end_tate = j + m + 1\n if a_t[j:end_tate] == b:\n ...
['Wrong Answer', 'Accepted']
['s414521745', 's573111493']
[3064.0, 3316.0]
[18.0, 22.0]
[323, 323]
p03804
u075595666
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N,M = [int(i) for i in input().split()]\na = []\nfor i in range(N):\n\tarray = input()\n\ta.append(array)\nb = []\nfor i in range(M):\n\tline = input()\n\tb.append(line)\nfor i in range(N-M):\n\tfor j in range(N-M):\n\t\tans = 'Yes'\n\t\tfor n in range(M):\n\t\t\tfor m in range(M):\n\t\t\t\tif a[i+n][j+m] == b[n][m]:...
['Runtime Error', 'Runtime Error', 'Accepted']
['s050947535', 's176727543', 's480529206']
[5656.0, 2940.0, 3064.0]
[494.0, 18.0, 18.0]
[355, 416, 406]
p03804
u077898957
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n,m = map(int,input().split())\n\nA = [[input()] for i in range(n)]\nB = [[input()] for i in range(m)]\nans = 0\nfor i in range(n-m):\n for j in range(n-m):\n temp=0\n for k in range(m):\n for l in range(m):\n if B[k][l]==A[i+k][j+l]:\n temp+=1\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s060032241', 's748560030', 's816524624']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 187.0]
[407, 412, 419]
p03804
u088974156
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['m,n =map(int,input().split())\na=[input() for _ in range(m)]\nb=[input() for _ in range(m)]\nr=any([r[j:j+m] for r in a[i:i+m]]==b for i in range (n-m+1) for j in range(n-m+1))\nprint("Yes" if r else "No")', 'n,m =map(int,input().split())\na=[input() for _ in range(n)]\nb=[input() for _ in range(m)]\nr=any([r[j:j+m] ...
['Runtime Error', 'Accepted']
['s387771273', 's915202100']
[3060.0, 3060.0]
[17.0, 20.0]
[201, 201]
p03804
u093492951
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import sys\nN, M = [int(i) for i in input().split()]\n\nA = [[i for i in input()] for j in range(N)]\nB = [[i for i in input()] for k in range(M)]\n\nfor i in range(N-M-1):\n for j in range(N-M-1):\n diff = 0\n\n for k in range(M):\n for l in range(M):\n if A[i+k][j+l] != B[...
['Wrong Answer', 'Accepted']
['s275550469', 's326008133']
[3064.0, 3064.0]
[19.0, 18.0]
[501, 501]
p03804
u095094246
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n,m=map(int,input().split())\na=[list(input()) for _ in range(n)]\nb=[list(input()) for _ in range(m)]\nr=n-m+1\nfor x in range(r**2):\n for y in range(m**2):\n if a[x//r][x%r]!=b[y//m][y%m]:\n break\n else:\n print('Yes')\n break\nelse:\n print('No')\n", "n,m=map(int,input().split())\na=[list(input(...
['Wrong Answer', 'Accepted']
['s700490184', 's451717400']
[9116.0, 9064.0]
[24.0, 127.0]
[257, 226]
p03804
u098572984
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = input().split()\nA=[]\nfor i in range(0,N):\n A.append(input())\nB=[]\nfor j in range(0,M):\n B.append(input())\n\nref_tuple = zip(range(0,N-M+1),range(0,N-M+1))\nt=False\nfor ref_row_a, ref_col_a in ref_tuple:\n for row_b, col_b in zip(range(0,M),range(0,M)):\n if not A[ref_row_a+row_b][ref_co...
['Runtime Error', 'Accepted']
['s104330711', 's938221231']
[3064.0, 3188.0]
[23.0, 25.0]
[499, 565]
p03804
u099918199
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['phase = 0\nif list_a != list_b:\n for i in range(0, n-m):\n for j in range(0, n-m):\n for k in range(0,m):\n if list_a[i+k][j:j+m] == list_b[k]:\n if k != m-1:\n continue\n else:\n pass\n ...
['Runtime Error', 'Accepted']
['s097273242', 's485173188']
[3060.0, 3064.0]
[17.0, 18.0]
[565, 812]
p03804
u106297876
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N,M = map(int,input().split())\nA = []\nB = []\nfor i in range(N):\n\ta = list(input())\n\tA.append(a)\nfor j in range(M):\n\tb = list(input())\n\tB.append(b)\n\nprint(A)\nans = "No"\n\nfor i in range(N-M+1):\n\tfor j in range(N-M+1):\n\t\tc = 0\n\t\tfor k in range(M):\n\t\t\tfor l in range(M):\n\t\t\t\tif A[i+k][i+l...
['Wrong Answer', 'Accepted']
['s696503414', 's489558648']
[3064.0, 3064.0]
[157.0, 161.0]
[369, 350]
p03804
u111365959
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["m,n = [int(x) for x in input().split()]\na = []\nb = []\nfor _ in range(m):\n a.append(int(input().replace('#','1').replace('.','2')))\nm = 0\nfor i in range(n):\n b.append(int(input().replace('#','1').replace('.','2')))\n if a[i] == b[i]:\n m += 1\nprint('Yes') if m == n else print('No')", "m,n = [int(x) for x...
['Wrong Answer', 'Accepted']
['s384780126', 's709262055']
[3064.0, 3060.0]
[17.0, 17.0]
[285, 208]
p03804
u112317104
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import sys\nfrom io import StringIO\nimport unittest\n\ndef resolve():\n N, M = map(int, input().split())\n A = [list(input()) for _ in range(N)]\n B = [list(input()) for _ in range(M)]\n\n ans = \'No\'\n for i in range(N):\n for j in range(N):\n if A[i][j] == B[0][0]:\n ...
['Wrong Answer', 'Accepted']
['s121195258', 's032342957']
[5704.0, 3064.0]
[45.0, 333.0]
[1519, 642]
p03804
u118211443
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m=map(int,input().split())\na = []\nfor i in range(n):\n a.append(input())\nb = []\nfor i in range(m):\n b.append(input())\n\nok=False\ncf=[]\nfor i in range(n-m+1):\n for j in range(n-m+1):\n for l in range(m):\n cf.append(a[i+l][j:j+m])\n #print(cf)\n if cf==b:\n ok...
['Wrong Answer', 'Accepted']
['s291836058', 's725024045']
[3064.0, 3064.0]
[22.0, 24.0]
[345, 359]
p03804
u125205981
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["def srch_all(ptn, str):\n index = []\n i = -1\n while True:\n i = str.find(ptn, i + 1)\n if i > -1:\n index.append(i)\n else:\n break\n return index\n\ndef judge(i, jlist, len):\n print(jlist)\n for l in jlist:\n k = 1\n while k < M:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s055642635', 's919766567', 's611458298']
[3064.0, 3700.0, 3064.0]
[24.0, 30.0, 24.0]
[884, 660, 886]
p03804
u131411061
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import sys\nN,M = map(int,input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\ncnt = 0\nif A < B:\n print('No')\n sys.exit()\nelse:\n for i in range(N):\n for j in range(M):\n if B[j] in A[i]:\n cnt+=1\n flag = True\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s223107562', 's574544623', 's850065932', 's423373998']
[2940.0, 3316.0, 2940.0, 3064.0]
[17.0, 23.0, 17.0, 19.0]
[451, 513, 451, 419]
p03804
u131634965
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M=map(int,input().split())\na=[input() for _ in range(N)]\nb=[input() for _ in range(M)]\n\nfor i in range(N-M+1): \n for j in range(N-M+1):\n count=0\n for k in range(M):\n for l in range(M):\n if a[i][j]==b[k][l]:\n count+=1\n if count==M*M:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s645786185', 's868817458', 's754946392']
[3064.0, 3064.0, 3064.0]
[132.0, 32.0, 33.0]
[374, 407, 411]
p03804
u140251125
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['# input\nN, M = map(int, input().split())\nA = [list(input()) for _ in range(N)]\nB = [list(input()) for _ in range(M)]\n\nfor i in range(N - M + 1):\n for j in range(N - M + 1):\n for k in range(M):\n for l in range(M):\n if B[k][l] == A[i + k][j + l]:\n ans += ...
['Runtime Error', 'Accepted']
['s366631930', 's909435118']
[3064.0, 12436.0]
[17.0, 166.0]
[515, 361]
p03804
u143903328
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["m,n = map(int,input().split())\na = []*m\nb = []*n\nflag = False\nfor i in range(m):\n a.append(input())\nfor j in range(n):\n b.append(input())\nflag = False\nfor i in range(m-n+1):\n for j in range(m-n+1):\n for k in range(n):\n if b[k] != a[i][j:j+n]:\n break\n else...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s134918863', 's191363576', 's407404785', 's415019236', 's600680796', 's200847031']
[3064.0, 3064.0, 3572.0, 3064.0, 3064.0, 3060.0]
[18.0, 19.0, 23.0, 19.0, 19.0, 18.0]
[477, 476, 491, 444, 476, 488]
p03804
u153902122
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import sys\nN, M = map(int,input().split())\nA,B=[],[]\nfor i in range(N):\n array = list(input().split())\n A.append(array)\nfor j in range(M):\n array = input().split()\n B.append(array)\n\nfor i in range(N-M+1):\n for j in range(N-M+1):\n new = [A[k][j:j+M] for k in range(i,i+M)]\n if ...
['Runtime Error', 'Accepted']
['s309471651', 's894706403']
[3064.0, 3064.0]
[17.0, 21.0]
[374, 288]
p03804
u167647458
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\na = [list(input()) for _ in range(n)]\nb = [list(input()) for _ in range(m)]\n\nfor i in range(n):\n for j in range(n):\n if i + m > n and j + m > n:\n a[i : i + m][j : j + m] == b\n print('Yes')\n break\nelse:\n\tprint('No')", "n, m = map(i...
['Wrong Answer', 'Accepted']
['s379317452', 's730086240']
[3060.0, 3064.0]
[18.0, 23.0]
[290, 443]
p03804
u177040005
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N,M = map(int,input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\nch = 0\nfor i in range(N-M+1):\n for j in range(1,M-1):\n cnt = 0\n for k in range(M):\n if B[k] == A[i+k][j:j+M]:\n cnt += 1\n if cnt == M:\n ch = 1\nif ch ...
['Wrong Answer', 'Accepted']
['s020861223', 's326468207']
[3060.0, 3060.0]
[22.0, 23.0]
[350, 336]
p03804
u183840468
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["a,b = [int(i) for i in input().split()]\n\nal = np.array([list(input()) for _ in range(a)])\nbl = np.array([list(input()) for _ in range(b)])\n\nflg = False\nfor i in range(a - b + 1):\n for j in range(a - b + 1):\n if(al[i:i+b,j:j+b] == bl).all():\n flg = True\n \nprint('Yes' if flg ...
['Runtime Error', 'Accepted']
['s304233318', 's308556982']
[3060.0, 22612.0]
[18.0, 411.0]
[319, 338]
p03804
u185948224
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = map(int, input().split())\n\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\nc = []\n\nfor i in range(N-M+1):\n for j in range(N-M+1):\n c = [A[i+k][j:j+M] for k in range(M)]\n if B==c:\n print('Yes')\n break\nif B!=c:print('No')\n", "N, M = map(int, i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s531495242', 's740857956', 's807961559']
[3060.0, 3060.0, 3060.0]
[21.0, 21.0, 21.0]
[283, 284, 320]
p03804
u186838327
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\na = ['']*n\nb = ['']*m\nfor i in range(n):\n a[i] = str(input())\nfor i in range(m):\n b[i] = str(input())\nfor i in range(n-m+2):\n c = a[0:m]\n for j in range(n-m+2):\n d = [e[j:j+m] for e in c]\n print(d)\n if b == d:\n print('Yes')\n exit()\nelse:\n print(...
['Wrong Answer', 'Accepted']
['s731073430', 's457232202']
[3572.0, 3064.0]
[25.0, 20.0]
[307, 296]
p03804
u198035503
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['s = input() # "3 2"\nn, m = s.split() # ("3", "2")\nn = int(n) # 3\nm = int(m) # 2\n\na = []\nfor i in range(0, n):\n a.append(input())\n\nb = []\nfor i in range(0, m):\n b.append(input())\n\ndef same(a, b, i, j):\n for k in range(0, len(b)):\n if a[i + k][j:j + len(b)] != b[k]:\n retur...
['Wrong Answer', 'Accepted']
['s465728310', 's700727141']
[3064.0, 3064.0]
[18.0, 18.0]
[589, 553]
p03804
u202619899
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\nA, B = [], []\nfor _ in range(N):\n A.append(input())\nfor _ in range(M):\n B.append(input())\n\nres = False\nfor sy in range(N - M + 1):\n for dy in range(M):\n y = sy + dy\n ok = True\n for i in range(N - M + 1):\n a = A[y][i:i + M]\n ...
['Wrong Answer', 'Accepted']
['s574241702', 's379479983']
[3064.0, 3064.0]
[21.0, 23.0]
[384, 392]
p03804
u220345792
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\ndata = []\nfor i in range(N):\n data.append(input())\ninput_data=[]\nfor i in range(M):\n input_data.append(input())\nflag_1 = False\nfor i in range(N - M + 1):\n for j in range(N - M + 1):\n if flag = False\n for k in range(M):\n for l in range(M):\n if data[i+k...
['Runtime Error', 'Accepted']
['s874334771', 's670435250']
[2940.0, 3064.0]
[17.0, 163.0]
[444, 431]
p03804
u222668979
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["from itertools import product\n\nn, m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\n\nfor i, j in product(range(n - m + 1), repeat=2):\n print(i,j)\n if all(a[i + k][j:] == b[k] for k in range(m)):\n print('Yes')\n break\nelse:\n print('No')\n", ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s106332867', 's338186541', 's944345348']
[3572.0, 3444.0, 3060.0]
[23.0, 21.0, 19.0]
[302, 307, 292]
p03804
u227082700
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m=map(int,input().split());a,b,ans=[input()for i in range(n)],[input()for i in range(m)],"No"\nfor i in range(n-m+1):\n for j in range(n-m+1):\n c=[(a[i])[j:j+m]for k in range(m)]\n if b==c:ans="Yes"\nprint(ans)', 'n,m=map(int,input().split());a=[input()for i in range(n)];b=[input()for i in range(m)];ans="No...
['Wrong Answer', 'Accepted']
['s997612071', 's481919364']
[3060.0, 3060.0]
[21.0, 21.0]
[215, 215]
p03804
u229959388
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\n\ndef main():\n\n for i in range(n-m+1):\n for j in range(n-m+1):\n if match(i, j):\n print("yes")\n exit()\n \n print("no")\n\ndef match(x, y):\n for i in ra...
['Wrong Answer', 'Accepted']
['s984248768', 's794112372']
[3064.0, 3064.0]
[18.0, 18.0]
[463, 463]
p03804
u230717961
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = [int(i) for i in input().split()]\n\ndef init_img(n):\n return [[0 if j == "#" else 1 for j in input()] for i in range(n)]\n\nimg = init_img(n)\n\ntmp_img = init_img(m)\n\nflg = False\n\nfor i in range(n):\n if flg:\n break\n\n for j in range(n):\n count = 0\n for k in range(m):\n...
['Runtime Error', 'Accepted']
['s596676142', 's896611053']
[3064.0, 3064.0]
[31.0, 25.0]
[468, 546]
p03804
u249895018
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['#include <string>\n\n\nusing namespace std;\n\nconst int nmax = 50;\nconst int mmax = 50;\nchar N_sq[nmax][nmax], M_sq[mmax][mmax];\n\n\nbool judge_match(int x, int y, int M){\n\tfor(int i=0;i<M;i++){\n\t\tfor(int j=0;j<M;j++){\n\t\t\tif(N_sq[y+i][x+j] != M_sq[y+i][x+j]) return false;\n\t\t}\n\t}\n\treturn true;\n}\n...
['Runtime Error', 'Accepted']
['s750503407', 's986624999']
[3064.0, 3064.0]
[24.0, 24.0]
[723, 827]
p03804
u250734103
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = map(int, input().split())\nA = [''] * N\nB = [''] * M\nfor i in range(N):\n A[i] = input()\nfor i in range(M):\n B[i] = input()\n\nmatch_cnt = 0\nfor i in range(N - M + 1):\n for j in range(N - M + 1):\n flag = True\n for y in range(M):\n for x in range(M):\n pr...
['Wrong Answer', 'Accepted']
['s983671712', 's263864800']
[9204.0, 9216.0]
[344.0, 33.0]
[515, 427]
p03804
u252805217
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import sys\n\nn, m = map(int, input().split())\na = [input() for i in range(n)]\nb = [input() for i in range(m)]\n\ncl = [[] for i in range(n - m + 1)]\nfor i in range(n - m + 1):\n for j in range(m):\n if not a[i].find(b[j]) == -1:\n cl[i].append(j)\nprint(cl)\nfor cs in cl:\n if cs == [0]:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s738524416', 's974231584', 's866751445']
[3064.0, 3064.0, 3064.0]
[18.0, 18.0, 26.0]
[450, 538, 275]
p03804
u252828980
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['a,b = map(int,input().split())\nli1 = [input() for i in range(a)]\nli2 = [input() for i in range(b)]\n#print(li1,li2)\nfor i in range(a-b+1):\n for j in range(a-b+1):\n flag = True\n for k in range(b):\n if li1[i+k][j:j+b] != li2[k]:\n flag = False\n break\n ...
['Wrong Answer', 'Accepted']
['s077154295', 's291025715']
[3060.0, 3060.0]
[19.0, 18.0]
[371, 378]
p03804
u254871849
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = [int(x) for x in input().split()]\nimg_a = [input() for _ in range(n)]\nimg_b = [input() for _ in range(m)]\n\nfound = False\nfor a in range(n - m + 1):\n border = 0\n isok = True\n while isok and not flag:\n for b in range(m):\n if img_b[b] in img_a[b+a][border:]:\n i...
['Runtime Error', 'Accepted']
['s104054555', 's320318707']
[3064.0, 12516.0]
[18.0, 166.0]
[1060, 474]
p03804
u259334183
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import sys\nn,m=map(int,input().split())\na=[]\nb=[]\nfor x in range(n):\n a.append(input())\nfor y in range(m):\n b.append(input())\nfor z in range(n-m+1):\n k=0\n l=0\n for w in range(n-m+1):\n if (a[w])[z:z+m]==b[k]:\n l+=1\n k+=1\n if l==m:\n p...
['Wrong Answer', 'Accepted']
['s654136266', 's560858015']
[3188.0, 3064.0]
[18.0, 18.0]
[389, 362]
p03804
u265506056
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import numpy as np\n\nN,M = map(int,input().split())\nA = np.array([list(input()) for _ in range(N)])\nB = np.array([list(input()) for _ in range(M)])\n\nbl = False\nfor i in range(N-M+1):\n for j in range(N-M+1):\n if (A[i:i+M,j:j+M] == B).all():\n bl = True\n\nanswer = 'Yes' if bl else 'No'\npr...
['Wrong Answer', 'Accepted']
['s694844672', 's261109679']
[27012.0, 27256.0]
[125.0, 125.0]
[327, 308]
p03804
u267300160
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import numpy as np\nN,M = map(int,input().split())\nA = np.array([list(input()) for i in range(N)])\nB = np.array([list(input()) for i in range(M)])\nfor i in range(N):\n for j in range(N):\n check = A[i:i+M,j:j+M]\n print(check)\n if (check == B).all():\n print("Yes")\n ...
['Runtime Error', 'Accepted']
['s154811807', 's628854715']
[12444.0, 12440.0]
[180.0, 167.0]
[327, 358]
p03804
u270681687
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\na = [input() for i in range(n)]\nb = [input() for i in range(m)]\n\n\nfor i in range(n-m+1):\n for j in range(n-m)+1:\n flag = 0\n for k in range(m):\n for l in range(m):\n if a[i + k][j + l] != b[k][l]:\n flag = 1\n ...
['Runtime Error', 'Accepted']
['s222666787', 's614023156']
[3060.0, 3060.0]
[18.0, 155.0]
[380, 380]
p03804
u277641173
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m=map(int,input().split())\na=[]\nfor i in range(n):\n a.append(input())\nb=[]\nfor i in range(m):\n b.append(input())\n\nres=0\nfor i in range(0,n-m+1):\n keep=0\n for j in range(i,i+m):\n if b[j-i] in a[j]:\n keep+=1\n if keep==m:\n print("Yes")\n res=1\n break\nif res=0:\n print("No")\n', ...
['Runtime Error', 'Accepted']
['s094226194', 's271503546']
[2940.0, 3064.0]
[17.0, 25.0]
[295, 381]
p03804
u282657760
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = map(int, input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\nans = 'Yes'\ndef match(i, j):\n for k in range(M):\n for l in range(M):\n if A[i+k][j+l] != B[k][l]:\n return False\n return True\nfor i in range(N-M+1):\n for j in range(N-M+1):\n if not match(i, ...
['Wrong Answer', 'Accepted']
['s453813637', 's215106093']
[3064.0, 3064.0]
[17.0, 20.0]
[349, 345]
p03804
u282813849
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N,M = [int(a) for a in input().split()]\nA = []\nB = []\nfor i in range(N):\n A.append(input())\nfor i in range(M):\n B.append(input()) \n\nwa = len(A[0])\nwb = len(B[0])\n \nmatched = False\nfor i1 in range(N - M + 1):\n for j1 in range(wa - wb +1):\n cnt = 0\n for i2 in range(M):\n #print(B[i2]," vs...
['Wrong Answer', 'Accepted']
['s808816935', 's371310755']
[9188.0, 9088.0]
[31.0, 35.0]
[496, 496]
p03804
u288430479
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m = map(int,input().split())\nlist_A = list(input() for i in range(n))\nlist_B = list(input() for i in range(m))\nprint(list_A)\nprint(list_B)\nk = "No"\nfor i in range(n-m+1):\n for t in range(n-m+1):\n if any( list_A[v+i][t:t+m]!=list_B[v] for v in range(m)):\n break\n k = "Yes"\nprint(k)', 'n,m...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s608568184', 's736289563', 's863160941']
[3060.0, 3064.0, 3060.0]
[17.0, 18.0, 19.0]
[300, 240, 278]
p03804
u298297089
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import numpy as np\nN,M = map(int, input().split())\nA = []\nfor i in range(N):\n A.append(input())\nB = []\nfor i in range(M):\n M.append(input())\nA = np.array(A)\nB = np.array(B)\n\nfor i in range(N-M):\n for j in range(N-M):\n if A[i:i+M, j:j+M] == B:\n print('Yes')\n exit()\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s543088504', 's600899812', 's561346429']
[12508.0, 12508.0, 3064.0]
[149.0, 149.0, 21.0]
[314, 314, 303]
p03804
u324549724
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\nfor i in range(n-m+1):\n for j in range(n-m+1):\n if a[i:i+m][j:j+m] == b[:]:\n print("Yes")\n exit()\nprint("No")\n', 'n, m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for ...
['Wrong Answer', 'Accepted']
['s934580357', 's297364537']
[3060.0, 3060.0]
[18.0, 21.0]
[221, 253]
p03804
u334712262
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\n\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\nfor i in range(N-M):\n for j in range(N-M):\n try:\n for k in range(i, i+M):\n for l in range(l, l+M):\n if A[i+k][j+k] != B[k][l]:\n raise ""\n else:\n print(\'Yes\'...
['Wrong Answer', 'Accepted']
['s260715360', 's429620609']
[3444.0, 3064.0]
[21.0, 18.0]
[341, 362]
p03804
u340781749
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["def solve(n, m, a, b):\n for i in range(n - m + 1):\n for j in range(n - m + 1):\n if a[i:i+m][j:j+m] == b:\n return True\n return False\n \n\nn, m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\nprint('Yes' if solve(n, m, a, b) else 'No')", "def solve(...
['Wrong Answer', 'Accepted']
['s179336076', 's622724421']
[3064.0, 3064.0]
[18.0, 20.0]
[293, 307]
p03804
u344959886
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import numpy as np\n\nn,m=map(int,input().split())\na= [list(input()) for i in range(n)] \nb= [list(input()) for i in range(m)] \nna=np.array(a)\n\nsa=n-m+1\n\nfor x in range(sa):\n for y in range(sa):\n\n if na[x:x+m,y:y+m].tolist()==b:\n print("Yes")\nprint("No")', 'import numpy as np\nimport s...
['Wrong Answer', 'Accepted']
['s306073549', 's323292118']
[12432.0, 12388.0]
[157.0, 157.0]
[272, 305]
p03804
u346395915
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m = map(int,input().split())\nli_a = [list(input()) for _ in range(n)]\nli_b = [list(input()) for _ in range(m)]\n\n\nfor i in range(n-m+1):\n for j in range(n-m+1):\n for k in range(m):\n if li_a[i+x][j:j+m] != li_b[x][:]:\n break\n else:\n print("Yes")\n ...
['Runtime Error', 'Accepted']
['s123285962', 's615855791']
[3064.0, 3060.0]
[17.0, 18.0]
[343, 343]
p03804
u357949405
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = map(int, input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\ndiff = N - M\nfor i in range(diff+1):\n for j in range(diff+1):\n flag = True\n for k in range(M):\n print(A[j+k][i:i+M])\n if not (B[k] in A[j+k][i:i+M]):\n flag...
['Wrong Answer', 'Accepted']
['s626871424', 's028205170']
[3444.0, 3060.0]
[38.0, 24.0]
[391, 358]
p03804
u362560965
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = (int(i) for i in input().split())\nA = []\nB = []\nfor i in range(N):\n A.append(input())\nfor i in range(M):\n B.append(input())\n\nfor i in range(N-M+1):\n if B[0] in A[i]:\n pos = A[i].find(B[j])\n flag = 0\n for j in range(M):\n if A[i+j][pos:pos+M] == B[j]:\n ...
['Runtime Error', 'Accepted']
['s140342026', 's380103332']
[3060.0, 3064.0]
[17.0, 18.0]
[443, 479]
p03804
u364741711
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import sys\n\nn,m=map(int,input().split())\nln=[list(input()) for i in range(n)]\nlm=[list(input()) for i in range(m)]\n\nflg=0\nfor i in range(n-m+1):\n for j in range(n-m+1):\n if ln[i][j:j+m]==lm[0][0:]:\n flg=1\n for k in range(m-1):\n if ln[i+k+1][j:j+m]!=lm[k+1][0:]:\n flg=0\n i...
['Wrong Answer', 'Accepted']
['s759273548', 's027084160']
[3064.0, 3064.0]
[18.0, 19.0]
[372, 372]
p03804
u366959492
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m=map(int,input().split())\na=[input() for i in range(n)]\nb=[input() for i in range(m)]\nfor i in range(n-m+1):\n for j in range(n-m+1):\n x=[]\n for k in range(m):\n x.append(a[i+k][j+m])\n if x==b:\n print("Yes")\n exit()\nprint("No")\n', 'n,m=map(int,inpu...
['Runtime Error', 'Accepted']
['s341245258', 's251308226']
[3060.0, 3060.0]
[17.0, 24.0]
[286, 288]
p03804
u370331385
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N,M = map(int,input().split())\nA = []\nA_portion = []\nB = []\njudge = 0\n\nif(N < M):\n print('No')\nelse:\n for i in range(N):\n a = input() + '?'*(M)\n A.append(list(a))\n for i in range(M):\n list_dummy = list('?'*(len(a)))\n A.append(list_dummy)\n \n for i in range(M):\n b = input()\n B.append(lis...
['Wrong Answer', 'Accepted']
['s407716418', 's330365570']
[29940.0, 3188.0]
[465.0, 83.0]
[563, 565]
p03804
u371467115
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N,M=map(int,input().strip().split(" "))\n\na=[input() for i in range(N)\nb=[input() for i in range(M)]\nN=0\n\nif b[i] in a[i]:\n N+=1\n \nif(N==M):\n print("Yes")\nelse:\n print("No")\n\n', 'N,M=map(int,input().strip().split(" "))\n\na=[]\nb=[]\n\nfor i in range(N):\n a.append(input())\n\nN=0\n\nfor ...
['Runtime Error', 'Accepted']
['s947098894', 's857535921']
[2940.0, 3064.0]
[17.0, 18.0]
[206, 244]
p03804
u373047809
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m, *d = open(0).read().split()\nn, m = int(n), int(m)\nr = range(n - m + 1)\nprint(["No","Yes"][all(d[n:] == [t[j:j+m] for t in d[i:i+m]] for i in r for j in r)])', 'n, m, *d = open(0).read().split()\nn, m = int(n), int(m)\nr = range(n - m + 1)\nprint(["No","Yes"][all(d[n:] == [t[j:j+m] for t in d[i:i+m]] for i in...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s594763716', 's892769384', 's911148572']
[3060.0, 3060.0, 3060.0]
[17.0, 18.0, 19.0]
[162, 165, 162]
p03804
u373304480
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import re\nn,m = map(int, input().split())\na = [input().strip() for i in range(n)]\nb = [input().strip() for i in range(m)]\n\nmc = n-m+1\nans = False\nfor ai in range(0, mc):\n if(ans):\n break\n ind = [x.start() for x in re.finditer(b[0], a[ai])]\n for i in ind:\n if(ans):\n break\n for bi in rang...
['Runtime Error', 'Accepted']
['s307141720', 's116881878']
[3188.0, 3188.0]
[19.0, 20.0]
[493, 510]
p03804
u376420711
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int, input().split())\na = []\nb = []\nfor i in range(n):\n a.append(input())\nfor i in range(m):\n b.append(input())\nans = "No"\nprint(a, b)\n\nfor i in range(n - m + 1):\n for j in range(n - m + 1):\n if a[i][j] == b[0][0]:\n c = []\n for k in range(m):\n ...
['Wrong Answer', 'Accepted']
['s326638881', 's691691094']
[3064.0, 3064.0]
[20.0, 20.0]
[398, 386]
p03804
u379794022
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['#!/usr/local/bin python\n# -*- coding: utf-8 -*-\n#\n# ~/PycharmProjects/atcoder/B-TempleteMatching.py\n#\nn, m = map(int, input().split())\na = []\nb = []\nis_contain = True\n\nfor i in range(n):\n a.append(input())\n\nfor i in range(m):\n b.append(input())\n\nprint(a)\nprint(b)\n\n\nfor i in range(n-m+1):\n ...
['Wrong Answer', 'Accepted']
['s385667819', 's212249903']
[3064.0, 3064.0]
[174.0, 169.0]
[581, 559]
p03804
u386819480
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["## ABC 054 b\nimport sys\nimport numpy as np\n\nn,m = (int(_) for _ in input().split())\na = [list(input()) for i in range(n)]\nb = [list(input()) for i in range(m)]\naa = np.array(a)\nbb = np.array(b)\n\nfor i in range(n-m+1):\n for j in range(n-m+1):\n if (bb[:, :] == aa[i:i+m, j:j+m]):\n print...
['Runtime Error', 'Accepted']
['s980783965', 's624798937']
[12472.0, 12484.0]
[151.0, 162.0]
[349, 343]
p03804
u391731808
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N,M = map(int,input().split())\nA = [input() for _ in [0]*N]\nB = [input() for _ in [0]*M]\nendFlg = False\nfor i in range(N-M):\n for j in range(N-M):\n breakFlg = False\n for k in range(M):\n for l in range(M):\n if A[i+k][j+l] != B[k][l]:\n breakFlg = T...
['Runtime Error', 'Accepted']
['s902927997', 's812112886']
[2940.0, 3064.0]
[17.0, 18.0]
[466, 482]
p03804
u393512980
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\nfor i in range(0, M - N):\n for j in range(0, M - N):\n if A == B[i:i+N+1][j:j+N+1]:\n flag = True\n if flag:\n break\n if flag:\n break\nif flag:\n print("Yes")\nelse:\n print("No")', 'N, M = ma...
['Runtime Error', 'Accepted']
['s287976650', 's336472907']
[3060.0, 3064.0]
[19.0, 21.0]
[291, 321]
p03804
u397953026
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m = map(int,input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\nfor i in range(n-m+1):\n for j in range(n-m+1):\n cnt = 0\n for k in range(m):\n if a[i+k][j:j+m] == b[k]:\n cnt += 1\n if cnt == m:\n print("YES")\n ...
['Wrong Answer', 'Accepted']
['s706508673', 's116701254']
[9140.0, 9060.0]
[36.0, 32.0]
[339, 339]
p03804
u430223993
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import sys\nn, m = map(int, input().split())\nA = [input() for _ in range(n)]\nB = [input() for _ in range(m)]\ncount = 0\nidx = 0\nposition = []\nfor b in B:\n if idx == 0 and count == 0:\n for i, a in enumerate(A[:-m]):\n if b in a:\n position.append(a.find(b))\n i...
['Wrong Answer', 'Accepted']
['s841386589', 's572674713']
[3064.0, 3060.0]
[18.0, 20.0]
[847, 297]
p03804
u440129511
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n,m=map(int,input().split())\na= [list(input()) for n in range(n)] \nb= [list(input()) for m in range(m)] \nm1=0\nfor i in range(n-m+1): \n for j in range(n-m+1): \n if b[i][j+k]==a[i][j] for k in range(n-m+1):m1+=1\n if m1==m:print('Yes') and exit()\n else:pass\n else:print('No')", "n,m=ma...
['Runtime Error', 'Runtime Error', 'Accepted']
['s805374098', 's961252107', 's104231844']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 21.0]
[340, 340, 283]
p03804
u452337391
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\nif N == M:\n if A == B:\n print("Yes")\n else:\n print("No")\n exit()\n \nfor a_i in range(N-M):\n if B[0] in A[a_i]:\n \n start = []\n for a_j in range(N-M+1):\n ...
['Wrong Answer', 'Accepted']
['s792427964', 's434878122']
[9192.0, 9164.0]
[29.0, 24.0]
[761, 736]
p03804
u454524105
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int, input().split())\na = [[i for i in input()] for _ in range(n)]\nb = [[i for i in input()] for _ in range(m)]\ncom = True\nfor h in range(n-m+1):\n for w in range(n-m+1):\n for hi in range(m):\n for wi in range(m):\n print(a[h+hi][w+wi], b[hi][wi])\n i...
['Wrong Answer', 'Accepted']
['s249078803', 's916509623']
[5360.0, 3064.0]
[510.0, 137.0]
[479, 431]
p03804
u457554982
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['[n,m]=list(map(int,input().split()))\nalist=[]\nblist=[]\ncounter=0\nfor i in range(n):\n alist.append(list(input()))\nfor i in range(m):\n blist.append(list(input()))\nclist=[]\nfor i in range(n-m):\n for j in range(n-m):\n for k in range(m):\n kari=[]\n for l in range(m):\n ...
['Wrong Answer', 'Accepted']
['s709531815', 's859612087']
[7412.0, 3064.0]
[106.0, 113.0]
[502, 624]
p03804
u459150945
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\nan = [input() for _ in range(n)]\nbn = [input() for _ in range(m)]\nlena = len(an[0])\nlenb = len(bn[0])\ndiff = n-m+1\nflag = False\nfor i in range(diff):\n for j in range(diff):\n print([a[j:diff+j] for a in an[i:diff+i]])\n if [a[j:diff+j] for a in an[i:diff+i]] =...
['Wrong Answer', 'Accepted']
['s847568910', 's643572059']
[4852.0, 3060.0]
[58.0, 19.0]
[424, 276]
p03804
u459283268
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\nexits = False\n\nfor i in range(n):\n for j in range(n):\n for k in range(n):\n match = False\n if a[i][k: k+m] == b[j] and not exits:\n for l in range(1, m):\n ...
['Runtime Error', 'Accepted']
['s456910412', 's982539396']
[3064.0, 3060.0]
[18.0, 26.0]
[558, 322]
p03804
u461833298
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = map(int, input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\nlenB = M**2\nflg=False\n\ndef check(i, j):\n cnt=0\n for k in range(M):\n for l in range(M):\n if A[i+k][i+j] == B[k][l]:\n cnt += 1\n if cnt==M**2:\n return True\n \...
['Runtime Error', 'Accepted']
['s198981009', 's521921348']
[3064.0, 3064.0]
[61.0, 59.0]
[465, 521]
p03804
u463655976
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = map(int, input().split())\n\nA = [list(map(int, input())) for _ in range(N)]\nB = [list(map(int, input())) for _ in range(M)]\n\ndef func():\n for i in range(N-M):\n for j in range(N-M):\n if all(A[i+k][j+l] == B[k][l] for k in range(M) for l in range(M)):\n return True\n return False\n\nprint...
['Runtime Error', 'Runtime Error', 'Accepted']
['s714221317', 's856678867', 's004943553']
[3064.0, 2940.0, 3064.0]
[19.0, 17.0, 18.0]
[340, 544, 369]
p03804
u468972478
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int, input().split())\na = [input() for i in range(n)]\nb = [input() for i in range(m)]\nans = "Yes"\nfor i in a:\n for j in b:\n if j not in a:\n ans = "No"\nprint(ans)\n', 'n, m = map(int, input().split())\na = [input() for i in range(n)]\nb = [input() for i in range(m)]\nfor i in a:\n for j in...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s219953087', 's469915592', 's153260730']
[9108.0, 9116.0, 9104.0]
[35.0, 26.0, 27.0]
[182, 186, 182]
p03804
u470542271
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\na = [list(input()) for _ in range(n)]\nb = [list(input()) for _ in range(m)]\n\nf = True\nfor i in range(n - m + 1):\n for j in range(n - m + 1):\n #check\n for x in range(m):\n for y in range(m):\n if a[x + i][y + j] != b[x][y]:\n ...
['Wrong Answer', 'Accepted']
['s004630130', 's595843201']
[3060.0, 3064.0]
[144.0, 148.0]
[373, 433]
p03804
u474270503
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N,M=map(int, input().split())\nA=[input() for _ in range(N)]\nB=[input() for _ in range(M)]\n\nfor i in range(N):\n if B[0] in A[i]:\n if all(B[j] in A[i+j] for j in range(1,min(M,N-i)):\n print('Yes')\n exit(0)\nprint('No')\n", "N,M=map(int, input().split())\nA=[input() for _ in range...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s093275757', 's405652405', 's634270622', 's096714146']
[2940.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 20.0]
[248, 253, 253, 253]
p03804
u483640741
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m=map(int,input().split())\n\npic1=[]\npic2=[]\n\nfor i in range(n):\n pic1.append(input())\n\nfor j in range(m):\n pic2.append(input())\n\n#print(pic1)\n#print(pic2)\n\nans="No"\n\nfor i in range(n-m+1):\n for j in range(n-m+1):\n flag=True\n for k in range(m):\n for l in range(m)...
['Runtime Error', 'Accepted']
['s005426253', 's831827968']
[3064.0, 3064.0]
[17.0, 23.0]
[498, 500]
p03804
u488127128
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["h,w = map(int, input().split())\nS = ['.' + input() + '.' for _ in range(h)]\nS.insert(0,'.'*(w+2))\nS.append('.'*(w+2))\n\nfor r in range(1, h+1):\n for c in range(1, w+1):\n if S[r][c] == '#':\n print('#', end='')\n continue\n else:\n count = 0\n count +=...
['Wrong Answer', 'Accepted']
['s159828648', 's379412685']
[3444.0, 3064.0]
[21.0, 17.0]
[472, 499]
p03804
u488497128
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['import sys\nimport os\n\ndef is_same(a, b):\n for i in range(len(a)):\n if a[i] != b[i]:\n return False\n return True\n\nN, M = list(map(lambda x: int(x), sys.stdin.readline().strip().split(" ")))\n\nA = []\nB = []\n\nfor _ in range(N):\n A.append(sys.stdin.readline().strip())\n\nfor _ in r...
['Wrong Answer', 'Accepted']
['s498005094', 's153648114']
[3064.0, 3064.0]
[18.0, 22.0]
[514, 552]
p03804
u497046426
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N, M = map(int, input().split())\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\nflag = False\nfor i in range(N - M + 1):\n for j in range(N - M + 1):\n if [r[j: j+M] for r in A[i: i+M]] == B:\n flag = True\n break\n if flag:\n break\nprint('YES' if flag el...
['Wrong Answer', 'Accepted']
['s825193833', 's204920854']
[3060.0, 3060.0]
[20.0, 20.0]
[315, 315]
p03804
u509661905
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['#!/usr/bin/env python3\n\nimport itertools\n\n\ndef judge(n, m, fig_a, fig_b):\n for dr, dc in itertools.product(range(n - m + 1), repeat=2):\n g = itertools.product(range(m), repeat=2)\n if all(fig_a[r0 + dr][c0 + dc] == fig_b[r0][c0] for r0, c0 in g):\n return True\n return False\n\n\...
['Wrong Answer', 'Accepted']
['s518712952', 's195194315']
[3064.0, 3064.0]
[20.0, 20.0]
[579, 579]
p03804
u518064858
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m=map(int,input().split())\na=[]\nb=[]\nc=0\nfor i in range(n):\n a.append(input())\nfor j in range(m):\n b.append(input())\nfor m in range(len(a)):\n if a[m].find(b[0])!=-1:\n print(1)\n for l in range(len(b)-1):\n if m+l+2>len(a):\n break\n if a[m+l+1][(...
['Wrong Answer', 'Accepted']
['s802501349', 's642756110']
[3064.0, 3064.0]
[18.0, 18.0]
[514, 476]
p03804
u520276780
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m = map(int, input().split())\na = [input() for _ in range(n)]\nb = [input() for _ in range(m)]\n\nflag = False \nfor i in range(n-m+1):\n flag = True\n for k in range(n-m+1):\n for j in range(i,i+m):\n if a[j][k:k+m]!=b[j-i]:\n flag = False\n break\n if...
['Wrong Answer', 'Accepted']
['s608434620', 's090460949']
[3060.0, 3060.0]
[17.0, 19.0]
[418, 533]
p03804
u530786533
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\n\na = []\nfor i in range(n):\n a.append(input())\n\nb = []\nfor i in range(m):\n b.append(input())\n\ndef func(base, target):\n for i in range(n-m+1):\n check = base[i:i+m]\n for j in range(n-m+1):\n check2 = [line[j:j+m] for line in check]\n ...
['Runtime Error', 'Accepted']
['s944984518', 's177553861']
[3188.0, 3064.0]
[18.0, 20.0]
[399, 380]
p03804
u539517139
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n,m=map(int,input().split())\nx='No'\na=[input() for _ in range(n)]\nb=[input() for _ in range(m)]\ndef c(i,j):\n global m,global a, global b\n for k in range(m):\n for l in range(m):\n if b[k][l]!=a[i+k][j+l]:\n return 0\n return 1\nfor i in range(n-m+1):\n for j in range(n-m+1):\n if c(i,j)==1...
['Runtime Error', 'Accepted']
['s605465886', 's697802272']
[2940.0, 3316.0]
[17.0, 21.0]
[341, 344]
p03804
u540290227
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["n, m = map(int, input().split())\nfor _ in range(n):\n a = list(input())\nfor _ in range(m):\n b = list(input())\nresult = []\n\nfor i in range(n-m+1):\n for j in range(n-m+1):\n for k in range(m):\n result.append(a[j+k][i:i+m])\n if b == result:\n print('Yes')\n ...
['Wrong Answer', 'Accepted']
['s053558775', 's361288185']
[3188.0, 3064.0]
[22.0, 18.0]
[327, 304]
p03804
u552738814
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n,m = map(int,input().split())\n\na_list = []\nb_list = []\nans = "No"\n\nfor i in range(n):\n a_list.append(input())\n\nfor i in range(m):\n b_list.append(input())\n\nfor i in range(n-m+1):\n for j in range(n-m+1):\n match = True\n for k in range(m):\n for l in range(m):\n ...
['Wrong Answer', 'Accepted']
['s475947126', 's102445989']
[9212.0, 9100.0]
[117.0, 113.0]
[451, 450]
p03804
u557494880
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N,M = int(input())\nA = []\nB = []\nfor i in range(N):\n A.append(input())\nfor i in range(M):\n B.append(input())\nfor i in range(N-M+1):\n for k in range(N-M+1):\n p = 1\n for j in range(i,i+M):\n a = A[j][k:k+M]\n b = B[j-i][k+M]\n if a != b:\n ...
['Runtime Error', 'Accepted']
['s500855170', 's299786297']
[3064.0, 3064.0]
[17.0, 19.0]
[338, 451]
p03804
u565204025
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['# -*- coding: utf-8 -*-\n\nn,m = map(int,input().split())\na = [i for i in range(n+1)]\nb = [i for i in range(m+1)]\nfor i in range(1,n+1):\n a[i] = list(input())\nfor i in range(1,m+1):\n b[i] = list(input())\nans = True\n\nfor x in range(1,len(a[1])-len(b[1]) + 1 + 1):\n for y in range(1,len(a)-len(b) + 1 ...
['Wrong Answer', 'Accepted']
['s261876039', 's550515735']
[3064.0, 3064.0]
[29.0, 153.0]
[534, 655]
p03804
u572343785
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N,M = map(int,input().split())\n\nA = [[0]]*N\nB = [[0]]*M\n\nfor i in range(N):\n A[i] = input()\nfor j in range(M):\n B[j] = input()\n\njudge = False \ncount = 0 \nfor i in range(N-M+1):\n for j in range(M):\n for k in range(M-N+1):\n if B[j]==A[i][k:k+M]:\n count += 1\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s010427679', 's100928482', 's140169875', 's216778520', 's237982296', 's280186259', 's444218106', 's670269189', 's628751637']
[3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0]
[17.0, 18.0, 18.0, 17.0, 17.0, 17.0, 17.0, 18.0, 23.0]
[464, 487, 497, 514, 464, 472, 472, 416, 516]
p03804
u576432509
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['icase=0\nif icase==0:\n n,m=map(int,input().split())\n a=[""]*n\n for i in range(n):\n a[i]=input()\n b=[""]*m\n for i in range(m):\n b[i]=input()\n# n,m=3,2\n# a=[\'#.#\', \'.#.\', \'#.#\']\n# b=[\'#.\', \'.#\']\n for ni in range(n-m+1):\n for nj in range(n-m+1):\n ...
['Wrong Answer', 'Accepted']
['s286569428', 's448842049']
[3316.0, 3064.0]
[19.0, 18.0]
[746, 748]
p03804
u580362735
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["N,M = map(int,input().split())\nN_ = []\nM_ = []\nfor i in range(N):\n N_.append(input())\n \nfor i in range(M):\n M_.append(input())\n\nfor i in range(N-M+1):\n count = 0\n for j in range(N-M+1):\n for k in range(M):\n if N_[i][j:j+M+1] == M_[k]:\n count = count + 1\n if count == M:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s220552711', 's812252290', 's115699661']
[3064.0, 3064.0, 3064.0]
[23.0, 22.0, 142.0]
[389, 354, 439]
p03804
u588081069
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['N, M = list(map(int, input().split()))\n\nA = [input() for _ in range(N)]\nB = [input() for _ in range(M)]\n\nresult = True\nfor i in range(N - M + 1):\n for j in range(N - M + 1):\n for x in range(M):\n for y in range(M):\n s1 = A[i+x][j+y]\n s2 = B[x][y]\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s327104373', 's635574498', 's679778257', 's003944334']
[3064.0, 3064.0, 3060.0, 3064.0]
[18.0, 20.0, 20.0, 18.0]
[492, 500, 428, 538]
p03804
u590241855
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
['n, m = map(int, input().split())\n\na = [input() for x in range(n)]\nb = [input() for x in range(m)]\n\nball = \'\'.join(b)\n\ndef check():\n for i in range(n):\n if i + m > n:\n continue\n\n for j in range(n):\n if j + m > n:\n continue\n\n aall = ""\n...
['Wrong Answer', 'Accepted']
['s064132040', 's742517367']
[3064.0, 3064.0]
[21.0, 21.0]
[489, 489]
p03804
u594244257
2,000
262,144
You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1×1. Also, the given images are binary images, and the color of each pixel is either white o...
["import functools \n\ndef find_indices(a, b, L):\n \n return [i for i in range(L) if b in a[i:]]\n\ndef solve():\n N,M = map(int, input().split())\n A = [input() for _ in range(N)]\n B = [input() for _ in range(M)]\n idx = 0\n start_pos = []\n for S_a in A:\n indices = find_indices(S_a, ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s520146547', 's641427007', 's415835169']
[3572.0, 3064.0, 3064.0]
[22.0, 17.0, 18.0]
[675, 549, 687]