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())
for j in range(n):
  b = int(input())
  for j in range(3):
    for k in range(3): 
    	if b==A[j][k]:
      		A[j][k]=-1

for k in range(3):
  if A[k][:]==[-1,-1,-1]:
    print('Yes')
    exit(0)
 
for k in range(3):
  if sum(A[:][k])==[-1,-1,-1]:
    print('Yes')
    exit(0)
 
if (A[0][0]==A[1][1]==A[2][2]==[-1,-1,-1])or(A[2][0]==A[1][1]==A[0][2]==[-1,-1,-1]): 
    print('Yes')
    exit(0)
    
print('No')

lis = []
for i in range(3):
  a= list(map(int,input().split()))
  lis.append(a)
n = int(input())
for j in range(n):
  b = int(input())
  for li in lis:
    if b in li:
      li[li.index(b)]=0
print(lis)
for k in range(8):
  if k<3:
    if sum(lis[k][:])==0:
      print('Yes')
      exit(0)
  elif (3<=k)and(k<6):
    if sum(lis[:][k-3])==0:
      print('Yes')
      exit(0)
  elif 6<=k:
    if (lis[0][0]+lis[1][1]+lis[2][2]==0)or(lis[2][0]+lis[1][1]+lis[0][2]==0): 
      print('Yes')
      exit(0)
print('No')

lis = []
for i in range(3):
  a= list(map(int,input().split()))
  lis.append(a)
n = int(input())
for j in range(n):
  b = int(input())
  for li in lis:
    if b in li:
      li[li.index(b)]=0
print(lis)
for k in range(7):
  print(k)
  if k<3:
    if sum(lis[k][:])==0:
      print('Yes')
      exit(0)
  elif (3<=k)and(k<6):
    if sum(lis[:][k-3])==0:
      print('Yes')
      exit(0)
  elif 6<=k:
    if (lis[0][0]+lis[1][1]+lis[2][2]==0)or(lis[2][0]+lis[1][1]+lis[0][2]==0): 
      print('Yes')
      exit(0)
print('No')

lis = []
for i in range(3):
  a= list(map(int,input().split()))
  lis.append(a)
n = int(input())
for j in range(n):
  b = int(input())
  for li in lis:
    if b in li:
      li[li.index(b)]=0

print(lis)
for k in range(3):
  if sum(lis[k][:])==0:
    print('Yes')
    exit(0)

for k in range(k):
  if sum(lis[:][k])==0:
    print('Yes')
    exit(0)

if (lis[0][0]+lis[1][1]+lis[2][2]==0)or(lis[2][0]+lis[1][1]+lis[0][2]==0): 
    print('Yes')
    exit(0)
    
print('No')

A = [list(map(int,input().split())) for i in range(3)]
n = int(input())
for j in range(n):
  b = int(input())
  for j in range(3):
    for k in range(3): 
    	if b==A[j][k]:
      		A[j][k]=-1
print(A)
for k in range(3):
  if A[k][:]==[-1,-1,-1]:
    print('Yes')
    exit(0)
 
for k in range(3):
  if sum(A[:][k])==[-1,-1,-1]:
    print('Yes')
    exit(0)
 
if (A[0][0]==A[1][1]==A[2][2]==[-1,-1,-1])or(A[2][0]==A[1][1]==A[0][2]==[-1,-1,-1]): 
    print('Yes')
    exit(0)
    
print('No')

lis = []
A = [list(map(int,input().split())) for i in range(3)]
n = int(input())
for j in range(n):
  b = int(input())
  for li in A:
    if b in li:
      li[li.index(b)]=-1
 
for k in range(3):
  if sum(A[k][:])==-3:
    print('Yes')
    exit(0)
 
for k in range(3):
  if sum(A[:][k])==-3:
    print('Yes')
    exit(0)
 
if (A[0][0]==A[1][1]==A[2][2]==-3)or(A[2][0]==A[1][1]==A[0][2]==-3): 
    print('Yes')
    exit(0)
    
print('No')

lis = []
for i in range(3):
  a= list(map(int,input().split()))
  lis.append(a)
n = int(input())
for j in range(n):
  b = int(input())
  for li in lis:
    if b in li:
      li[li.index(b)]=0
print(lis)
for k in range(6):
  if k<3 and sum(lis[k][:])==0: 
    print('Yes')
    exit(0)
  elif (3<=k or k<6) and sum(lis[:][k-3])==0:
    print('Yes')
    exit(0)
  elif (lis[0][0]+lis[1][1]+lis[2][2]==0)or(lis[2][0]+lis[1][1]+lis[0][2]==0): 
    print('Yes')
    exit(0)
print('No')

lis = []
A = [list(map(int,input().split())) for i in range(3)]
n = int(input())
for j in range(n):
  b = int(input())
  for j in range(3):
    for k in range(3): 
    	if b==A[j][k]:
      		A[j][k]=-1
 
for k in range(3):
  if sum(A[k][:])==-3:
    print('Yes')
    exit(0)
 
for k in range(3):
  if sum(A[:][k])==-3:
    print('Yes')
    exit(0)
 
if (A[0][0]==A[1][1]==A[2][2]==-3)or(A[2][0]==A[1][1]==A[0][2]==-3): 
    print('Yes')
    exit(0)
    
print('No')

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

for k in range(3):
  if sum(A[k][:])==0:
    print('Yes')
    exit(0)

ri = [[a[k] for a in A]for k in range(3)]

for k in range(3):
  if sum(ri[:][k])==0:
    print('Yes')
    exit(0)
    
if (A[0][0]+A[1][1]+A[2][2]==0)or(A[2][0]+A[1][1]+A[0][2]==0): 
    print('Yes')
    exit(0)
    
print('No')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted