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 = np.zeros((3,3))
for i in range(3):
  for j in range(3):
    a[i][j] = input()
A = a.T
N = input()
b = np.zeros(N)
for i in range(N):
  b[i] = input()
k = 0
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j,k] == b[i]:
        a[j,k] == 0
c = np.array(a[0,0],a[1,1],a[2,2])
d = np.array(a[0,2],a[1,1],a[2,0])
k = 1
for i in range(3):
  if a[i].cumprod * A[i].cumprod == 0:
    k = 0
if c.cumprod * d.cumprod == 0:
  k = 0
if k:
  print('No')
else:
  print('Yes')
  
    

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = [input() for i in range(N)]
A = [[0,0,0],[0,0,0],[0,0,0]]
x = 0
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        A[j][k] = 1
for i in range(3):
  if A[i][0]*A[i][1]*A[i][2] == 1 | A[0][i]*A[1][i]*A[2][i] == 1:
    x = 1
if A[0][0]*A[1][1]*A[2][2] == 1 | A[0][2]*A[1][1]*A[2][0] == 1:
  x = 1
if x:
  print('Yes')
else:
  print('No')
  

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = [input() for i in range(N)]

tate0 = len(set(a[0]) & set(b)) == 3
tate1 = len(set(a[1]) & set(b)) == 3
tate2 = len(set(a[2]) & set(b)) == 3
yoko0 = len(set([a[i][0] for i in range(3)]) & set(b)) == 3
yoko1 = len(set([a[i][1] for i in range(3)]) & set(b)) == 3
yoko2 = len(set([a[i][2] for i in range(3)]) & set(b)) == 3
naname0 = len(set([a[0][0],a[1][1],a[2][2]]) & set(b)) == 3
naname1 = len(set([a[0][2],a[1][1],a[2][0]]) & set(b)) == 3
if tate0 | tate1 | tate2 | yoko0 | yoko1 | yoko2 | naname0 | naname1
  print('Yes')
else:
  print('No')
  

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = [input() for i in range(N)]
A[[1,1,1],[1,1,1],[1,1,1]]
x = 1
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        A[j][k] = 0
for i in range(3):
  if A[i][0]*A[i][1]*A[i][2] == 0 | A[0][i]*A[1][i]*A[2][i] == 0:
    x = 0
if A[0][0]*A[1][1]*A[2][2] == 0 | A[0][2]*A[1][1]*A[2][0] == 0:
  x = 0
if x:
  print('No')
else:
  print('Yes')
  

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = [input() for i in range(n)]
x = 1
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
for i in range(3):
  if a[i][0]*a[i][1]*a[i][2] == 0 | a[0][i]*a[1][i]*a[2][i] == 0:
    x = 0
if a[0][0]*a[1][1]*a[2][2] == 0 | a[0][2]*a[1][1]*a[2][0] == 0:
  x = 0
if x:
  print('No')
else:
  print('Yes')
  

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = np.zeros(N)
for i in range(N):
  b[i] = int(input())
x = 1
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
for i in range(3):
  if a[i][0]*a[i][1]*a[i][2] == 0 | a[0][i]*a[1][i]*a[2][i] == 0:
    x = 0
if a[0][0]*a[1][1]*a[2][2] == 0 | a[0][2]*a[1][1]*a[2][0] == 0:
  x = 0
if x:
  print('No')
else:
  print('Yes')
  

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = [input() for i in range(N)]
A = [[1,1,1],[1,1,1],[1,1,1]]
x = 1
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        A[j][k] = 0
for i in range(3):
  if A[i][0]*A[i][1]*A[i][2] == 0 | A[0][i]*A[1][i]*A[2][i] == 0:
    x = 0
if A[0][0]*A[1][1]*A[2][2] == 0 | A[0][2]*A[1][1]*A[2][0] == 0:
  x = 0
if x:
  print('No')
else:
  print('Yes')
  

import numpy as np
a = np.zeros((3,3))
for i in range(3):
  for j in range(3):
    a[i][j] = int(input())
A = a.T
N = int(input())
b = np.zeros(N)
for i in range(N):
  b[i] = int(input())
k = 0
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j,k] == b[i]:
        a[j,k] = 0
a
c = np.array([a[0,0],a[1,1],a[2,2]])
d = np.array([a[0,2],a[1,1],a[2,0]])
k = 1
for i in range(3):
  if (a[i] == 0).any() | (A[i] == 0).any():
    k = 0
if (c == 0).any() | (d == 0).any():
  k = 0
if k:
  print('No')
else:
  print('Yes')

a = [input().split() for l in range(3)]
a = [[int(item) for item in row] for row in a]
N = int(input())
b = [input() for i in range(N)]
x = 1
for i in range(N):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
for i in range(3):
  if a[i][0]*a[i][1]*a[i][2] == 0 | a[0][i]*a[1][i]*a[2][i] == 0:
    x = 0
if a[0][0]*a[1][1]*a[2][2] == 0 | a[0][2]*a[1][1]*a[2][0] == 0:
  x = 0
if x:
  print('No')
else:
  print('Yes')
  

a = [input().split() for l in range(3)]
n = int(input())
b = [input() for i in range(n)]
c = [a[0][0],a[1][1],a[2][2]]
d = [a[0][2],a[1][1],a[2][0]]
tate1 = len(set(a[0]) & set(b))
tate2 = len(set(a[1]) & set(b))
tate3 = len(set(a[2]) & set(b))
yoko1 = len(set([x[0] for x in a]) & set(b))
yoko2 = len(set([x[1] for x in a]) & set(b))
yoko3 = len(set([x[2] for x in a]) & set(b))
naname1 = len(set(c) & set(b))
naname2 = len(set(d) & set(b))
bingo = [tate1,tate2,tate3,yoko1,yoko2,yoko3,naname1,naname2]
if 3 in bingo:
  print("Yes")
else:
  print("No")

  

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted