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
 
a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())
 
a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])
 
n = int(input)
for i in range(n):
  b = int(input())
  a[a == b] = 0

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

import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input())
for i in range(n):
  b = int(input())
  np.where(a == b,0,a)

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

import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input())
for i in range(n):
  b = int(input())
  np.where(a == b,0,a)

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

import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input())
for i in range(n):
  b = int(input())
  a = np.where(a == b, 0, a)

print(a)

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

import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input)
for i in range(n):
  b = int(input())
  a[a = b] = 0

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


import numpy as np
 
a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())
 
a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])
 
n = int(input)
for i in range(n):
  b = int(input())
  np.where(a == b,0,a)

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

import numpy as np

a1,a2,a3 = map(int,input().split())
a4,a5,a6 = map(int,input().split())
a7,a8,a9 = map(int,input().split())

a = np.array([[a1, a2, a3], [a4, a5, a6], [a7, a8, a9]])

n = int(input())
for i in range(n):
  b = int(input())
  a = np.where(a == b, 0, a)

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted