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

c=range(9)
lists=[]
lists.append(a0)
lists.append(a1)
lists.append(a2)
lists.append(a3)
lists.append(a4)
lists.append(a5)
lists.append(a6)
lists.append(a7)
lists.append(a8)

listb=[]
for j in range(N):
  listb.append(b[j])

for il in c:
    for ib in range(N):
        if b[ib]==lists[il]:
            k=il
            lists[k]=0
            
if lists[0]==lists[1] and lists[2]==lists[1] and lists[0]==0:
    print ('Yes')
elif lists[3]==lists[4] and lists[5]==lists[4] and lists[3]==0:
    print ('Yes')
elif lists[6]==lists[7] and lists[8]==lists[7] and lists[6]==0:
    print ('Yes')
elif lists[0]==lists[3] and lists[3]==lists[6] and lists[0]==0:
    print ('Yes')
elif lists[1]==lists[4] and lists[4]==lists[7] and lists[1]==0:
    print ('Yes')
elif lists[2]==lists[5] and lists[5]==lists[8] and lists[2]==0:
    print ('Yes')
elif lists[0]==lists[4] and lists[4]==lists[8] and lists[0]==0:
    print ('Yes')
elif lists[2]==lists[4] and lists[4]==lists[6] and lists[2]==0:
    print ('Yes')
else:
    print ('No')

a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[input() for i in range(N)]

c=range(9)
lists=[]
lists.append(a0)
lists.append(a1)
lists.append(a2)
lists.append(a3)
lists.append(a4)
lists.append(a5)
lists.append(a6)
lists.append(a7)
lists.append(a8)

listb=[]
for j in range(N):
  listb.append(b[j])

for il in c:
    for ib in range(N):
        if b[ib]==lists[il]:
            k=il
            lists[k]=0
            
if lists[0]==lists[1] and lists[2]==lists[1]:
    print ('Yes')
elif lists[3]==lists[4] and lists[5]==lists[4]:
    print ('Yes')
elif lists[6]==lists[7] and lists[8]==lists[7]:
    print ('Yes')
elif lists[0]==lists[3] and lists[3]==lists[6]:
    print ('Yes')
elif lists[1]==lists[4] and lists[4]==lists[7]:
    print ('Yes')
elif lists[2]==lists[5] and lists[5]==lists[8]:
    print ('Yes')
elif lists[0]==lists[4] and lists[4]==lists[8]:
    print ('Yes')
elif lists[2]==lists[4] and lists[4]==lists[6]:
    print ('Yes')
else:
    print ('No')

a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for i in range(N)]

s=range(9)
lists=[]
lists.append(a0)
lists.append(a1)
lists.append(a2)
lists.append(a3)
lists.append(a4)
lists.append(a5)
lists.append(a6)
lists.append(a7)
lists.append(a8)

listb=[]
for j in range(N):
  listb.append(b[j])
t=0
for il in range(9):
  for ib in range(N):
    if b[ib]==lists[il]:
      lists[il]=0
            
if lists[0]==lists[1] and lists[2]==lists[1] and lists[0]==0:
  print ('Yes')
elif lists[3]==lists[4] and lists[5]==lists[4] and lists[3]==0:
  print ('Yes')
elif lists[6]==lists[7] and lists[8]==lists[7] and lists[6]==0:
  print ('Yes')
elif lists[0]==lists[3] and lists[3]==lists[6] and lists[0]==0:
  print ('Yes')
elif lists[1]==lists[4] and lists[4]==lists[7] and lists[1]==0:
  print ('Yes')
elif lists[2]==lists[5] and lists[5]==lists[8] and lists[2]==0:
  print ('Yes')
elif lists[0]==lists[4] and lists[4]==lists[8] and lists[0]==0:
  print ('Yes')
elif lists[2]==lists[4] and lists[4]==lists[6] and lists[2]==0:
  print ('Yes')
else:
  print ('No')

Verdicts: Wrong Answer

Wrong Answer

Accepted