TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a11, a12, a13 = map(int, input().split())
a21, a22, a23 = map(int, input().split())
a31, a32, a33 = map(int, input().split())
n = int(input())
l = [int(input()) for i in range(n)]
if (a11 and a12 and a13 in l) or (a21 and a22 and a23 in l) or (a31 and a32 and a33 in l) or (a11 and a21 and a31 in l) or (a22 and a12 and a32 in l) or (a13 and a23 and a33 in l) or (a11 and a22 and a33 in l) or (elif a13 and a22 and a31 in l):
    print('Yes')
else :
    print('No')

a11, a12, a13 = input().split()
a21, a22, a23 = input().split()
a31, a32, a33 = input().split()
n = int(input())
l = [int(input()) for i in range(n)]

if all(a11 and a12 and a13) in l:
    print('Yes')
elif all(a12 and a22 and a23) in l:
    print('Yes')
elif all(a31 and a32 and a33) in l:
    print('Yes')
elif all(a11 and a21 and a31) in l:
    print('Yes')
elif all(a12 and a22 and a32) in l:
    print('Yes')
elif all(a13 and a23 and a33) in l:
    print('Yes')
elif all(a11 and a22 and a33) in l:
    print('Yes')
elif all(a13 and a22 and a31) in l:
    print('Yes')
else :
    print('No')

a11, a12, a13 = map(int, input().split())
a21, a22, a23 = map(int, input().split())
a31, a32, a33 = map(int, input().split())
n = int(input())
l = [int(input()) for i in range(n)]
t1 = (a11, a12, a13)
t2 = (a12, a22, a23)
t3 = (a31, a32, a33)
t4 = (a11, a21, a31)
t5 = (a12, a22, a32)
t6 = (a13, a23, a33)
t7 = (a11, a22, a33)
t8 = (a13, a22, a31)
ls = [t1, t2, t3, t4, t5, t6, t7, t8]
for i in ls:
    if i in l :
        print('Yes')
        break
    else :
        print('No')
        break

A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):

A=[list(map(int,input().split())) for i in range(3)]
N=int(input())
b=[]
for i in range(N):
    b.append(int(input()))


for i in range(3):
    for j in range(3):
        for x in range(N):
            if A[i][j]==b[x]:
                A[i][j]=0

for i in range(3):
    if A[i][0]==0 and A[i][1]==0 and A[i][2]==0:
        print("Yes")
        break
for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
        print("Yes")
        break
if A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0:
    print("Yes")
    break
if A[0][2] == 0 and A[1][1] == 0 and A[2][0] == 0:
    print("Yes")
    break
print("No")



import sys
A=[list(map(int,input().split())) for i in range(3)]
N=int(input())
b=[]
for i in range(N):
    b.append(int(input()))


for i in range(3):
    for j in range(3):
        for x in range(N):
            if A[i][j]==b[x]:
                A[i][j]=0

for i in range(3):
    if A[i][0]==0 and A[i][1]==0 and A[i][2]==0:
        print("Yes")
        sys.exit(0)
for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
        print("Yes")
        sys.exit(0)
if A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0:
    print("Yes")
    sys.exit(0)
if A[0][2] == 0 and A[1][1] == 0 and A[2][0] == 0:
    print("Yes")
    sys.exit(0)
print("No")
# your code goes here

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]

key = []
for i, v in enumerate(A):
    for k, j in enumerate(v):
        if (j in B):
            key.append([i, k])

ans = [[[0, 0], [1, 0], [2, 0]], [[0, 1], [1, 1], [2, 1]], [[0, 2], [1, 2], [2, 2]], [[0, 0], [1, 1], [2, 2]], [
    [0, 2], [1, 1], [2, 0]], [[0, 0], [0, 1], [0, 2]], [[1, 0], [1, 1], [1, 2]], [[2, 0], [2, 1], [2, 2]]]

for i in ans:
    for j in i:
        if (j in key.sort()):
            print('Yes')
            exit()

print('No')


A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]

key = []
for i, v in enumerate(A):
    for k, j in enumerate(v):
        if (j in B):
            key.append([i, k])

ans = [[[0, 0], [1, 0], [2, 0]], [[0, 1], [1, 1], [2, 1]], [[0, 2], [1, 2], [2, 2]], [[0, 0], [1, 1], [2, 2]], [
    [0, 2], [1, 1], [2, 0]], [[0, 0], [0, 1], [0, 2]], [[1, 0], [1, 1], [1, 2]], [[2, 0], [2, 1], [2, 2]]]

for i in ans:
    count = 0
    for j in i:
        if (j in key):
            count += 1
    if (count == 3):
        print('Yes')
        exit()

print('No')

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0

if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[3]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]):
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")

a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

for num in b:
  for x in range(3):
    for y in range(3):
      if a[x][y] == num:
        a[x][y] = 0

if sum(a[0]) == 0 or sum(a[1]) == 0 or sum(a[2]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][1],a[2][2]]) == 0 or sum([a[2][0],a[1][1],a[0][2]]) == 0:
  print("Yes")
elif sum([a[0][0],a[1][0],a[2][0]]) == 0 or sum([a[0][1],a[1][1],a[2][1]]) == 0 or sum([a[0][2],a[1][2],a[2][2]]) == 0:
  print("Yes")                                                 
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):

def check(grid):
	bingo=False
	#row
	for i in range(3):
		count=0
		for j in range(3):
			if grid[i][j]==1:
				count+=1
	if count==3:
		print(1)
		bingo=True
	#col
	count=0
	for i in range(3):
		for j in range(3):
			if grid[j][i]==1:
				count+=1
	if count==3:
		print(2)
		bingo=True
	
	count=0
	for i in range(3):
		if grid[i][i]==1:
			count+=1
	if count==3:
		print(3)
		bingo=True
	
	count=0
	for i in range(3):
		if grid[i][2-i]==1:
			count+=1
	if count==3:
		print(4)
		bingo=True
		
	return bingo
		
pos={}
for i in range(3):
	temp=list(map(int,input().split(' ')))
	for j,t in enumerate(temp):
		pos[t]=[i,j]
grid=[[0 for i in range(3)] for j in range(3)]

n=int(input())
for i in range(n):
	t=int(input())
	if t in pos.keys():
		r,c=pos[t]
		grid[r][c]=1
bingo=check(grid)

if bingo:
	print("Yes")
else:
	print("No")


def check(grid):
	bingo=False
	#row
	for i in range(3):
		count=0
		for j in range(3):
			if grid[i][j]==1:
				count+=1
		if count==3:
			bingo=True
	#col
	for i in range(3):
		count=0
		for j in range(3):
			if grid[j][i]==1:
				count+=1
		if count==3:
			bingo=True
	
	count=0
	for i in range(3):
		if grid[i][i]==1:
			count+=1
	if count==3:
		bingo=True
	
	count=0
	for i in range(3):
		if grid[i][2-i]==1:
			count+=1
	if count==3:
		bingo=True
		
	return bingo
		
pos={}
for i in range(3):
	temp=list(map(int,input().split(' ')))
	for j,t in enumerate(temp):
		pos[t]=[i,j]
grid=[[0 for i in range(3)] for j in range(3)]

n=int(input())
for i in range(n):
	t=int(input())
	if t in pos.keys():
		r,c=pos[t]
		grid[r][c]=1
bingo=check(grid)

if bingo:
	print("Yes")
else:
	print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
A = [[],[],[]]
b = []

for i in range(0,3):
    A[i] = [int(x) for x in input().split(" ")]
N = int(input())
for i in range(0,N):
  b.append(int(input()))

for i in range(0,3):
  for j in range(0,3):
    for n in range(0,N):
      if A[i][j] == b[n]:
        A[i][j] = 0

if A[0] == [0,0,0] or A[1] == [0,0,0] or A[2] == [0,0,0]:
  print("Yes")
elif [A[0][0],A[1][0],A[2][0]] == [0,0,0]:
  print("yes")
elif [A[0][1],A[1][1],A[2][1]] == [0,0,0]:
  print("yes")
elif [A[0][2],A[1][2],A[2][2]] == [0,0,0]:
  print("yes")
elif [A[0][0],A[1][1],A[2][2]] == [0,0,0]:
  print("yes")
elif [A[2][0],A[1][1],A[0][2]] == [0,0,0]:
  print("yes")
else:
  print("No")

A = [[],[],[]]
b = []

for i in range(0,3):
    A[i] = [int(x) for x in input().split(" ")]
N = int(input())
for i in range(0,N):
  b.append(int(input()))

for i in range(0,3):
  for j in range(0,3):
    for n in range(0,N):
      if A[i][j] == b[n]:
        A[i][j] = 0

if A[0] == [0,0,0] or A[1] == [0,0,0] or A[2] == [0,0,0]:
  print("Yes")
elif [A[0][0],A[1][0],A[2][0]] == [0,0,0]:
  print("Yes")
elif [A[0][1],A[1][1],A[2][1]] == [0,0,0]:
  print("Yes")
elif [A[0][2],A[1][2],A[2][2]] == [0,0,0]:
  print("Yes")
elif [A[0][0],A[1][1],A[2][2]] == [0,0,0]:
  print("Yes")
elif [A[2][0],A[1][1],A[0][2]] == [0,0,0]:
  print("Yes")
else:
  print("No")


Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a1= list(map(int,input().solit()))
a2= list(map(int,input().solit()))
a3= list(map(int,input().solit()))
a = a1 + a2 + a3

n = int(input())


for _ in range(n):
  b = int(input())
  if b in a:
    a[a.index(b)]=0
  
  
check = 0
for i in range(3):
  
  if (a[3*i]==a[3*i+1] and a[3*i+1]==a[3*i+2]) or (a[i]==a[i+3] and a[i+3]==a[i+6]):
        check+=1

if (a[0]==a[4] and a[4]==a[8]) or (a[2]==a[4] and a[4]==a[6]):
    check+=1
if check>0:
    print("Yes")
else:
    print("No")

a1= list(map(int,input().split()))
a2= list(map(int,input().split()))
a3= list(map(int,input().split()))
a = a1 + a2 + a3
 
n = int(input())
 

for _ in range(n):
  b = int(input())
  if b in a:
    a[a.index(b)]=0
  
  
check = 0
for i in range(3):
  
  if (a[3*i]==a[3*i+1] and a[3*i+1]==a[3*i+2]) or (a[i]==a[i+3] and a[i+3]==a[i+6]):
        check+=1

if (a[0]==a[4] and a[4]==a[8]) or (a[2]==a[4] and a[4]==a[6]):
    check+=1
if check>0:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import numpy as np

grid = []
for i in range(3):
    array = list(map(int,input().strip().split()))
    grid.append(array)
    
grid = np.array(grid)

N = int(input().split())
s = [int(input()) for i in range(N)]

for i in s:
    b = np.where(grid==i,0,grid)
    
if grid[0][0]==0 & grid[0][1]==0 & grid[0][2]==0:
    han = "Yes"
elif grid[1][0]==0 & grid[1][1]==0 & grid[1][2]==0:
    han = "Yes"
elif grid[2][0]==0 & grid[2][1]==0 & grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 & grid[1][0]==0 & grid[2][0]==0:
    han = "Yes"
elif grid[0][1]==0 & grid[1][1]==0 & grid[2][1]==0:
    han = "Yes"
elif grid[0][2]==0 & grid[1][2]==0 & grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 & grid[1][1]==0 & grid[2][2]==0:
    han = "Yes"
elif grid[0][2]==0 & grid[1][1]==0 & grid[2][0]==0:
    han = "Yes"
else:
    han = "No"
print(han)


import numpy as np

grid = []
for i in range(3):
    array = list(map(int,input().strip().split()))
    grid.append(array)
    
grid = np.array(grid)

N = int(input())
s = [int(input()) for i in range(N)]

for i in s:
    grid = np.where(grid==i,0,grid)
    
#print(grid)
    
if grid[0][0]==0 and grid[0][1]==0 and grid[0][2]==0:
    han = "Yes"
elif grid[1][0]==0 and grid[1][1]==0 and grid[1][2]==0:
    han = "Yes"
elif grid[2][0]==0 and grid[2][1]==0 and grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 and grid[1][0]==0 and grid[2][0]==0:
    han = "Yes"
elif grid[0][1]==0 and grid[1][1]==0 and grid[2][1]==0:
    han = "Yes"
elif grid[0][2]==0 and grid[1][2]==0 and grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 and grid[1][1]==0 and grid[2][2]==0:
    han = "Yes"
elif grid[0][2]==0 and grid[1][1]==0 and grid[2][0]==0:
    han = "Yes"
else:
    han = "No"
print(han)


Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import numpy as np

bingo = np.zeros([3,3])
check = np.zeros([3,3])
choice = []
flag = "No"

for i in range(3):
    a = input().split()
    a = [int(x) for x in a]
    bingo[i] = a
N = int(input())
for i in range(N):
    choice.append(int(input()))

convert = bingo.reshape([9])
for i in range(9):
    for j in range(N):
        if(convert[i] == j):
            ckeck[i//3][i%3] = 1
            continue

for i in range(3):
    if(check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1):
        flag = "Yes"
    elif(check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1):
        flag = "Yes"
if(check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1):
    flag = "Yes"
elif(check[2][0] == 1 and check[1][1] == 1 and check[0][2] == 1):
    flag = "Yes"

print(flag)


bingo = np.zeros([3,3])
check = np.zeros([3,3])
choice = []
flag = "N0"

for i in range(3):
    a = input().split()
    a = [int(x) for x in a]
    bingo[i] = a
N = int(input())
for i in range(N):
    choice.append(int(input()))

convert = bingo.reshape([9])
for i in range(9):
    for j in range(N):
        if(convert[i] == j):
            ckeck[i//3][i%3] = 1
            continue

for i in range(3):
    if(check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1):
        ok = "Yes"
    elif(check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1)
        ok = "Yes"
if(check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1):
    ok = "Yes"
elif(check[2][0] == 1 and check[1][1] == 1 and check[0][2] == 1):
    ok = "Yes"

print(ok)


import numpy as np

bingo = np.zeros([3,3])
check = np.zeros([3,3])
choice = []
flag = "No"

for i in range(3):
    a = input().split()
    a = [int(x) for x in a]
    bingo[i] = a
N = int(input())
for i in range(N):
    choice.append(int(input()))

convert = bingo.reshape([9])
for i in range(9):
    for j in choice:
        if(convert[i] == j):
            check[i//3][i%3] = 1
            continue

            
for i in range(3):
    if(check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1):
        flag = "Yes"
    elif(check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1):
        flag = "Yes"
if(check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1):
    flag = "Yes"
elif(check[2][0] == 1 and check[1][1] == 1 and check[0][2] == 1):
    flag = "Yes"

print(flag)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]

for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] == B[k]:
                A[i][j] = 0

ans = "No"
for i in range(3):
    if A[i][0] == 0 and A[i][1] == 0 and A[i][2] == 0:
        ans = "Yes"
    elif A[0][i] == 0 and A[1][i] == 0 and A[2][i] == 0:
        ans = "Yes"
    elif A[0][0] and A[1][1] and A[2][2] == 0:
        ans = "Yes"
    elif A[0][2] and A[1][1] and A[2][0] == 0:
        ans = "Yes"

print(ans)

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]

for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] == B[k]:
                A[i][j] = 0

ans = "No"
for i in range(3):
    if A[i][0] == 0 and A[i][1] == 0 and A[i][2] == 0:
        ans = "Yes"
    elif A[0][i] == 0 and A[1][i] == 0 and A[2][i] == 0:
        ans = "Yes"
    elif A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0:
        ans = "Yes"
    elif A[0][2] == 0 and A[1][1] == 0 and A[2][0] == 0:
        ans = "Yes"

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ka = a + b + c
x = int()
n = int(input())
for i in range(n):
    k = int(input())
    if k in ka: ka[ka.index(k)] = x
print(ka)
ans = "No"
if ka[0] == x and ka[1] == x and ka[2] == x:ans = "Yes"
elif ka[3] == x and ka[4] == x and ka[5] == x:ans = "Yes"
elif ka[6] == x and ka[7] == x and ka[8] == x:ans = "Yes"
elif ka[0] == x and ka[3] == x and ka[6] == x:ans = "Yes"
elif ka[1] == x and ka[4] == x and ka[7] == x:ans = "Yes"
elif ka[2] == x and ka[5] == x and ka[8] == x:ans = "Yes"
elif ka[0] == x and ka[4] == x and ka[8] == x:ans = "Yes"
elif ka[2] == x and ka[4] == x and ka[6] == x:ans = "Yes"
print(ans)


a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ka = a + b + c
x = int()
n = int(input())
for i in range(n):
    k = int(input())
    if k in ka: ka[ka.index(k)] = x
ans = "No"
if ka[0] == x and ka[1] == x and ka[2] == x:ans = "Yes"
elif ka[3] == x and ka[4] == x and ka[5] == x:ans = "Yes"
elif ka[6] == x and ka[7] == x and ka[8] == x:ans = "Yes"
elif ka[0] == x and ka[3] == x and ka[6] == x:ans = "Yes"
elif ka[1] == x and ka[4] == x and ka[7] == x:ans = "Yes"
elif ka[2] == x and ka[5] == x and ka[8] == x:ans = "Yes"
elif ka[0] == x and ka[4] == x and ka[8] == x:ans = "Yes"
elif ka[2] == x and ka[4] == x and ka[6] == x:ans = "Yes"
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import math
h,w = map(int, input().split())
print(1 if h==1 or w==1 else math.ceil(h*w/2) )

al = []
ans = 'No'
for i in range(3):
    al.append(list(map(int, input().split())))
n = int(input())
bl = [int(input()) for i in range(n)]
for i in bl:
    for a in al:
        if i in a:
            a[a.index(i)]=0           
t1 = al[0][0]+al[1][1]+al[2][2]
t2 = al[0][2]+al[1][1]+al[2][0]
if t1 ==0 or t2==0:
    ans = 'Yes'
else:
    for a in al:
        if sum(a)==0:
            ans = 'Yes'
            break
        else:
            for va in zip(*al):
                if sum(va)==0:
                    ans = 'Yes'
                    break
print(ans)


    

    


                
    
    

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import numpy as np

xy = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
num = [list(map(int, input().split())) for _ in range(n)]

def input_b(xy:list, num:int, result:list):
    for i in range(3):
        if num in xy[i]:
            for j in range(3):
                if num==xy[i][j]:
                    result[i][j]=1
    return result
  
def check_result(result:list):

    
    for i in range(3):
        if 3 == np.array(result[0]).sum():
            return "Yes" 

    if 3 in np.array(result[0]) + np.array(result[1]) + np.array(result[2]):
        return "Yes"

    if 3 == result[0][0] + result[1][1] + result[2][2]:
        return"Yes"
    
    return "No"

for i in num:
    result=input_b(xy,i[0],result)

print(check_result(result))

import numpy as np
 
xy = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
num = [list(map(int, input().split())) for _ in range(n)] 
result = [[0,0,0],[0,0,0],[0,0,0]]
 
def input_b(xy:list, num:int, result:list):
    for i in range(3):
        if num in xy[i]:
            for j in range(3):
                if num==xy[i][j]:
                    result[i][j]=1
    return result
  
def check_result(result:list):
    for i in range(3):
        if 3 == np.array(result[i]).sum():
            return "Yes" 
    if 3 in np.array(result[0]) + np.array(result[1]) + np.array(result[2]):
        return "Yes"
    if 3 == result[0][0] + result[1][1] + result[2][2]:
        return"Yes"
    if 3 == result[0][2] + result[1][1] + result[2][0]:
        return"Yes"
    return "No"
 
for k in num:
    result=input_b(xy,k[0],result)
 
print(check_result(result))

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
matrix = []
for i in range(3):
    line = []
    line = input().split(" ")
    matrix.append(line)

n = int(input())
chosen = 0

for i in range(n):
    b = input()
    for i in range(3):
        for j in range(3):
            if matrix[i][j] == b:
                chosen += 1
                matrix[i][j] = 0
bingo = False
if chosen == 9:
    bingo = True
# Squares conditions
elif (chosen == 8):
    for i in range(3):
        for j in range (3):
            if(i != 1 and j != 1):
                if(matrix[i][j] != 0):
                    break
                if(i == 2 and j == 2):
                    bingo = True
elif (chosen >= 3):
    for i in range(3):
        if(matrix[i][0] == 0 and matrix[i][1] == 0 and matrix[i][2] == 0):
            bingo = True
            break
        elif(matrix[0][i] == 0 and matrix[1][i] == 0 and matrix[2][i] == 0):
            bingo = True
            break
    if(matrix[1][1] and (matrix[0][0] == 0 and matrix[2][2] == 0) or (matrix[0][2] == 0 and matrix[2][0] == 0)):
        bingo = True

if bingo:
    print("Yes")
else:
    print("No")


A = [ [] for i in range (3)]
for i in range(3) :
    A[i] = input().split()

fl = False 

B = [[False for i in range (3)] for i in range(3)]

N = int(input())
for b in range (N) :
    tmp = input()
    for i in range (3) :
        for j in range (3) :
            if int(tmp) == int(A[i][j]) :
                B[i][j] = True

if B[0][0] and B[1][1] and B[2][2] :
    fl = True
elif B[0][2] and B[1][1] and B[2][0] :
    fl = True
elif B[0][0] and B[0][1] and B[0][2] :
    fl = True
elif B[1][0] and B[1][1] and B[1][2] :
    fl = True
elif B[2][0] and B[2][1] and B[2][2] :
    fl = True
elif B[0][0] and B[1][0] and B[2][0] :
    fl = True
elif B[0][1] and B[1][1] and B[2][1] :
    fl = True
elif B[0][2] and B[1][2] and B[2][2] :
    fl = True

print ('Yes' if fl else 'No')

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
A = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = []
for i in range(n):
    b.append(int(input()))

V = [[False,False,False],[False,False,False],[False,False,False]]

for i in b:
    for i in range(len(A)):
        for j in range(len(A[i])):
            if(A[i][j] == i):
                V[i][j] = True


def judge(V):
    for i in range(3):
        if(V[i][0] and V[i][1] and V[i][2]):
            return True
        if(V[0][i] and V[1][i] and V[2][i]):
            return True

    if(V[0][0] and V[1][1] and V[2][2]):
        return True
    if (V[0][2] and V[1][1] and V[2][0]):
        return True
    return False

if(judge(V)):
    print("Yes")
else:
    print("No")

A = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = []
for i in range(n):
    b.append(int(input()))

V = [[False,False,False],[False,False,False],[False,False,False]]

for bb in b:
    for i in range(len(A)):
        for j in range(len(A[i])):
            if(A[i][j] == bb):
                V[i][j] = True


def judge(V):
    for i in range(3):
        if(V[i][0] and V[i][1] and V[i][2]):
            return True
        if(V[0][i] and V[1][i] and V[2][i]):
            return True

    if(V[0][0] and V[1][1] and V[2][2]):
        return True
    if (V[0][2] and V[1][1] and V[2][0]):
        return True
    return False

#print(V)

if(judge(V)):
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
R = 3
C = 3
matrix = [] 
print("Enter the entries rowwise:") 
 
for i in range(R):         
    a =[] 
    for j in range(C):  
         a.append(int(input())) 
    matrix.append(a) 
  
# For printing the matrix 
for i in range(R): 
    for j in range(C): 
        print(matrix[i][j], end = " ") 
    print() 

i= int(input("Enter: "))
if i in matrix:
    print("Yes")
else:
    print("No")

a, b, c = (input("Enter 1 ")).split()
e,f, g = (input("Enter 2")).split()
h,i,j = (input("Enter 3")).split()
x = (input("Enter: "))
if (x==a or x==b or x==c or x==e or x==f or x==g or x==h or x==i or x==j):
    print("Yes")
else:
    print("No")

row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))
n = int(input())
arr = []
for i in range(n):
    temp = int(input())
    arr.append(temp)
#
if row1[0] in arr and row1[1] in arr and row1[2] in arr or row2[0] in arr and row2[1] in arr and row2[2] in arr or row3[0] in arr and row3[1] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[0] in arr and row3[0] in arr or row1[1] in arr and row2[1] in arr and row3[1] in arr or row1[2] in arr and row2[2] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[1] in arr and row3[2] in arr or row1[2] in arr and row2[1] in arr and row3[0] in arr:
    print("Yes")
    exit()
else:
    print("No")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import sys
A1 = list(map(int, sys.stdin.readline().split()))
A2 = list(map(int, sys.stdin.readline().split()))
A3 = list(map(int, sys.stdin.readline().split()))
N = int(sys.stdin.readline())
b = [int(sys.stdin.readline()) for _ in range(N)]
A = A1 + A2 + A3
i = 0
while i <= 8:
  if b.count(A[i]):
    A[i] = 101
  i += 1
bingoFlag = False
k = 0
while k <= 2:
  if A[k] == A[k+3] == A[k+6]:
    bingoFlag = True
    break
  k += 1
if A[0] == A[4] == A[8] or A[2] == A[4] == A[6]:
  bingoFlag = True
if bingFlag:
  print("Yes")
else:
  print("No")


import sys
A1 = list(map(int, sys.stdin.readline().split()))
A2 = list(map(int, sys.stdin.readline().split()))
A3 = list(map(int, sys.stdin.readline().split()))
N = int(sys.stdin.readline())
b = [int(sys.stdin.readline()) for _ in range(N)]
A = A1 + A2 + A3
i = 0
while i <= 8:
  if b.count(A[i]):
    A[i] = 101
  i += 1
bingoFlag = False
k = 0
while k <= 2:
  if A[k] == A[k+3] == A[k+6] or A[k*3] == A[k*3 + 1] == A[k*3 + 2]:
    bingoFlag = True
    break
  k += 1
if A[0] == A[4] == A[8] or A[2] == A[4] == A[6]:
  bingoFlag = True
if bingoFlag:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
first_array = [int(i) for i in input().split()]
second_array = [int(i) for i in input().split()]
third_array = [int(i) for i in input().split()]
N = int(input())
bs = []
for i in range(N):
  bs.append(i)
first_array = [(i in bs) for i in first_array]
second_array = [(i in bs) for i in second_array]
third_array = [(i in bs) for i in third_array]
check_array = [True for i in range(3)]
bingo = [first_array, second_array, third_array]

def main():
  bingo_count = int()
  for horizon in bingo:
    bingo_count += int(horizon == check_array)
  for i in range(3):
    vertical = []
    for j in range(3):
      vertical.append(bingo[j][i])
    bingo_count += int(vertical == check_array)
  diagnal = [bingo[i][up] for up,i in enumerate(reversed(range(3)))]
  bingo_count += int(diagnal == check_array)
  diagnal = [bingo[i][i] for i in range(3)]
  bingo_count += int(diagnal == check_array)
  if bingo_count > 0:
    print("Yes")
  else:
    print("No")
main()


# B

first_array = [int(i) for i in input().split()]
second_array = [int(i) for i in input().split()]
third_array = [int(i) for i in input().split()]
N = int(input())
bs = []
for i in range(N):
    bs.append(int(input()))

first_array = [(i in bs) for i in first_array]
second_array = [(i in bs) for i in second_array]
third_array = [(i in bs) for i in third_array]
check_array = [True for i in range(3)]
bingo = [first_array, second_array, third_array]
# [0][0] == first_array[0]

def main():
    bingo_count = int()
    
    for horizon in bingo:
        bingo_count += int(horizon == check_array)

    # vertical
    for i in range(3):
        vertical = []
        for j in range(3):
            vertical.append(bingo[j][i])
        bingo_count += int(vertical == check_array)

    # diagnal 1
    diagnal = [bingo[i][i] for i in range(3)]
    bingo_count += int(diagnal == check_array)

    # diagnal 2
    diagnal = [bingo[i][up] for up,i in enumerate(reversed(range(3)))]
    bingo_count += int(diagnal == check_array)
    
    
    if bingo_count > 0:
        print("Yes")
    else:
        print("No")
main()

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,inout().split())
N=int(input())
L=[int(input()) for i in range(N)]
if a in L and b in L and c in L:
  print('Yes')
elif d in L and e in L and  f in L:
  print('Yes')
elif g in L and h in L and  i in L:
  print('Yes')
elif a in L and d in L and  g in L:
  print('Yes')
elif b in L and e in L and  h in L:
  print('Yes')
elif c in L and f in L and  i in L:
  print('Yes')
elif a in L and e in L and  i in L:
  print('Yes')
elif c in L and e in L and  g in L:
  print('Yes')
else:
  print('No')



a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
N=int(input())
L=[int(input()) for i in range(N)]
if a in L and b in L and c in L:
  print('Yes')
elif d in L and e in L and  f in L:
  print('Yes')
elif g in L and h in L and  i in L:
  print('Yes')
elif a in L and d in L and  g in L:
  print('Yes')
elif b in L and e in L and  h in L:
  print('Yes')
elif c in L and f in L and  i in L:
  print('Yes')
elif a in L and e in L and  i in L:
  print('Yes')
elif c in L and e in L and  g in L:
  print('Yes')
else:
  print('No')
 

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
C=a.flatten()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

            if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")

import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
c=a.flatten()
C=c.tolist()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

            if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")

import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
c=a.flatten()
C=c.tolist()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input9())
r = []
for _ in range(3):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                a[i][j] = 0
ans = 'No'
for i in range(3):
    if a[i][0] + a[i][1] + a[i][2] == 0: ans = 'Yes'
    if a[0][i] + a[1][i] + a[2][i] == 0: ans = 'Yes'
if a[0][0] + a[1][1] + a[2][2] == 0: ans = 'Yes'
if a[0][2] + a[1][1] + a[2][0] == 0: ans = 'Yes'
print(ans)

a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for _ in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                a[i][j] = 0
ans = 'No'
for i in range(3):
    if a[i][0] + a[i][1] + a[i][2] == 0: ans = 'Yes'
    if a[0][i] + a[1][i] + a[2][i] == 0: ans = 'Yes'
if a[0][0] + a[1][1] + a[2][2] == 0: ans = 'Yes'
if a[0][2] + a[1][1] + a[2][0] == 0: ans = 'Yes'
print(ans)

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
BingoRow = 3
BingoList = [list(map(int,input().split())) for i in range(BingoRow)]

TargetRow = int(input())
TargetList = [int(input()) for i in range(TargetRow)]

ansList = []
x = 0
flg = false
for row in BingoList:
  for num in row:
    flg = false
    for target in TargetList:
      if num == target:
        ansList.append(1)
        flg = true
    if !flg:
      ansList.append(0)

if (ansList[0] + ansList[1] + ansList[2]) == 3:
  print('Yes')
elif (ansList[3] + ansList[4] + ansList[5]) == 3:
  print('Yes')
elif (ansList[6] + ansList[7] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[3] + ansList[6]) == 3:
  print('Yes')
elif (ansList[1] + ansList[4] + ansList[7]) == 3:
  print('Yes')
elif (ansList[2] + ansList[5] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[4] + ansList[8]) == 3:
  print('Yes')
elif (ansList[2] + ansList[4] + ansList[6]) == 3:
  print('Yes')
else:
  print('No')


BingoRow = 3
BingoList = [list(map(int,input().split())) for i in range(BingoRow)]
 
TargetRow = int(input())
TargetList = [int(input()) for i in range(TargetRow)]
 
ansList = []
x = 0
flg = False
for row in BingoList:
  for num in row:
    flg = False
    for target in TargetList:
      if num == target:
        ansList.append(1)
        flg = True
    if not flg:
      ansList.append(0)
 
if (ansList[0] + ansList[1] + ansList[2]) == 3:
  print('Yes')
elif (ansList[3] + ansList[4] + ansList[5]) == 3:
  print('Yes')
elif (ansList[6] + ansList[7] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[3] + ansList[6]) == 3:
  print('Yes')
elif (ansList[1] + ansList[4] + ansList[7]) == 3:
  print('Yes')
elif (ansList[2] + ansList[5] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[4] + ansList[8]) == 3:
  print('Yes')
elif (ansList[2] + ansList[4] + ansList[6]) == 3:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
ans="No"
A=3
t=[0]*A
x=[0]*A
y=[0]*A
for i in range(A):
    t[i], x[i], y[i] = map(int, input().split())
#print(x[1])

N=int(input())
S=[]
for _ in range(N):
  S.append(input())
#print(S[0])
S1=[int(s) for  s in S]
for i in range(A):
  if t[i] in S1:
    t[i]=0
  if x[i] in S1:
    x[i]=0
  if y[i] in S1:
    y[i]=0
print(t[0])
if t.count(0)==3:
  ans="Yes"
if x.count(0)==3:
  ans="Yes"
if y.count(0)==3:
  ans="Yes"
if t[0]==0 and x[1]==0 and y[2]==0:
  ans="Yes"
if t[2]==0 and x[1]==0 and y[0]==0:
  ans="Yes"
print(ans)

ans="No"
A=3
t=[0]*A
x=[0]*A
y=[0]*A
for i in range(A):
    t[i], x[i], y[i] = map(int, input().split())
#print(x[1])

N=int(input())
S=[]
for _ in range(N):
  S.append(input())
#print(S[0])
S1=[int(s) for  s in S]
for i in range(A):
  if t[i] in S1:
    t[i]=0
  if x[i] in S1:
    x[i]=0
  if y[i] in S1:
    y[i]=0
#print(t[0])
if t.count(0)==3:
  ans="Yes"
if x.count(0)==3:
  ans="Yes"
if y.count(0)==3:
  ans="Yes"
if t[0]==0 and x[1]==0 and y[2]==0:
  ans="Yes"
if t[2]==0 and x[1]==0 and y[0]==0:
  ans="Yes"
if t[0]==0 and x[0]==0 and y[0]==0:
  ans="Yes"
if t[1]==0 and x[1]==0 and y[1]==0:
  ans="Yes"
if t[2]==0 and x[2]==0 and y[2]==0:
  ans="Yes"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
from functools import reduce

a = reduce(lambda a, b: a + b, [list(map(int, input().split())) for _ in range(3)])
print(a)
n = int(input())
b = {int(input()): None for _ in range(n)}

r = [(ai in b) for ai in a]

combs = [
    [0,1,2],
    [3,4,5],
    [6,7,8],
    [0,3,6],
    [1,4,7],
    [2,5,8],
    [0,4,8],
    [2,4,6],
]
if any([all([r[c] for c in comb]) for comb in combs]):
    print('Yes')
else:
    print('No')

a = []
for _ in range(3):
    a += list(map(int, input().split()))
n = int(input())
b = {int(input()): None for _ in range(n)}

r = [(ai in b) for ai in a]

combs = [
    [0,1,2],
    [3,4,5],
    [6,7,8],
    [0,3,6],
    [1,4,7],
    [2,5,8],
    [0,4,8],
    [2,4,6],
]
if any([all([r[c] for c in comb]) for comb in combs]):
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
def main():
    A = [[int(a) for a in input().split()] for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    print(A, N, b)
    for k in b:
        for i in range(3):
            for j in range(3):
                if A[i][j] == k:
                    A[i][j] = "x"
    bingo = False
    if A[0][0] == A[0][1] == A[0][2] == "x" or \
       A[1][0] == A[1][1] == A[1][2] == "x" or \
       A[2][0] == A[2][1] == A[2][2] == "x" or \
       A[0][0] == A[1][0] == A[2][0] == "x" or \
       A[0][1] == A[1][1] == A[2][1] == "x" or \
       A[0][2] == A[1][2] == A[2][2] == "x" or \
       A[0][0] == A[1][1] == A[2][2] == "x" or \
       A[0][2] == A[1][1] == A[2][0] == "x":
       bingo = True

    if bingo:
        print("Yes")
    else:
        print("No")
main()

def main():
    A = [[int(a) for a in input().split()] for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    for k in b:
        for i in range(3):
            for j in range(3):
                if A[i][j] == k:
                    A[i][j] = "x"
    bingo = False
    if A[0][0] == A[0][1] == A[0][2] == "x" or \
       A[1][0] == A[1][1] == A[1][2] == "x" or \
       A[2][0] == A[2][1] == A[2][2] == "x" or \
       A[0][0] == A[1][0] == A[2][0] == "x" or \
       A[0][1] == A[1][1] == A[2][1] == "x" or \
       A[0][2] == A[1][2] == A[2][2] == "x" or \
       A[0][0] == A[1][1] == A[2][2] == "x" or \
       A[0][2] == A[1][1] == A[2][0] == "x":
       bingo = True
       
    if bingo:
        print("Yes")
    else:
        print("No")
main()

Verdicts: Wrong Answer

Accepted