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=[[int(x) for x in input().split()] for i in range(3)]
n=int(input())
b=list(map(int,input().split()))
for i in b:
  for j in a:
    if i==j:
      j=0
if a[0][0]==a[0][1]==a[0][2] or a[1][0]==a[1][1]==a[1][2] or a[2][0]==a[2][1]==a[2][2] or a[0][0]==a[1][0]==a[2][0] or a[0][1]==a[1][1]==a[2][1] or a[0][2]==a[1][2]==a[2][2] or a[0][0]==a[1][1]==a[2][2] or a[2][0]==a[1][1]==a[0][2]:
  print('Yes')
else:
  print('No')
  

A=[]
for i in range(3):
    A.append(list(map(int,input().split())))
N=int(input())
for i in range(N):
    b=int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k]==b:
                A[j][k]=0
 
flag=False
for i in range(3):
    if A[i][:]==[0,0,0]:
        flag=True
    elif A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
        flag=True
    elif A[1][1]==0 and A[0][2]==0 and A[2][0]==0:
        flag=True
    else A[0][0]==0 and A[1][1]==0 and A[2][2]==0:
        flag=True
if flag:
    print('Yes')
else:
    print('No')

A=[[int(x) for x in inout().split()]for i in range(3)]
n=int(input())
b=list(map(int,input().split()))
for i in range(3):
    if A[i][0] in b and A[i][1] in b and A[i][2] in b:
        print('Yes')
        exit()
    elif A[0][i] in b and A[1][i] in b and A[2][i] in b:
        print('Yes')
        exit()
if A[0][0] in b and A[1][1] in b and A[2][2] in b:
    print('Yes')
    exit()
if A[2][0] in b and A[1][1] in b and A[0][2] in b:
    print('Yes')
    exit()
print('No')

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

A=[[int(x) for x in input().split()]for i in range(3)]
N = int(input())
b=list(map(int,input().split()))
 
for i in range(3):
    if A[i][0] in b and A[i][1] in b and A[i][2] in b:
        print('Yes')
        exit()
for i in range(3):
    if A[0][i] in b and A[1][i] in b and A[2][i] in b:
        print('Yes')
        exit()
if A[0][0] in b and A[1][1] in b and A[2][2] in b:
    print('Yes')
    exit()
if A[2][0] in b and A[1][1] in b and A[0][2] in b:
    print('Yes')
    exit() 
print('No')

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

A=[[int(x) for x in input().split()]for i in range(3)]
n=int(input())
b=list(map(int,input().split()))
for i in range(3):
    if A[i][0] in b and A[i][1] in b and A[i][2] in b:
        print('Yes')
        exit()
    elif A[0][i] in b and A[1][i] in b and A[2][i] in b:
        print('Yes')
        exit()
if A[0][0] in b and A[1][1] in b and A[2][2] in b:
    print('Yes')
    exit()
if A[2][0] in b and A[1][1] in b and A[0][2] in b:
    print('Yes')
    exit()
print('No')

A=[[int(x) for x in 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):
    if A[i][0] in b and A[i][1] in b and A[i][2] in b:
        print('Yes')
        exit()
for i in range(3):
    if A[0][i] in b and A[1][i] in b and A[2][i] in b:
        print('Yes')
        exit()
if A[0][0] in b and A[1][1] in b and A[2][2] in b:
    print('Yes')
    exit()
if A[2][0] in b and A[1][1] in b and A[0][2] in b:
    print('Yes')
    exit() 
print('No')

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted