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):
c=[]
w=0
for i in range(3):
    c.append(list(map(int,input().split())))
N=int(input())
d=[]
for y in range(N):
    d.append(int(input()))
for n in d:
    for p in c:
        for j in p:
            if n in j:
                j=0
for t in c:
    for h in t:
        if c.count(0)==3:
            o=1
            break
    else:
        continue
    break
for v in range(3):
    w=0
    for k in c:
        if k[v]==0:
            w+=1
        if w==3:
            o=1
w=0
for ji in range(3):
    if c[ji][ji]==0:
        w+=1
    if w==3:
        o=1
w=0
for ji2 in range(3):
    if c[ji2][3-ji2]==0:
        w+=1
    if w==3:
        o=1
for v1 in range(3):
    w=0
    for k in range(3):
        if c[k][v1]==0:
            w+=1
        if w==3:
            o=1

if o==1:
    print("Yes")
else:
    print("No")











a=list(map(int,input().split()))
b=len(a)
c=[a]
w=0
for i in range(b-1):
    c.append(list(map(int,input().split())))
N=int(input())
d=[]
for y in range(N):
    d.append(int(input()))
for n in d:
    for p in c:
        for j in p:
            if n in j:
                j=0
for t in c:
    for h in t:
        if c.count(0)==b:
            o=1
            break
    else:
        continue
    break
for v in range(b):
    w=0
    for k in c:
        if k[v]==0:
            w+=1
        if w==b:
            o=1
w=0
for ji in range(b):
    if c[ji][ji]==0:
        w+=1
    if w==b:
        o=1
w=0
for ji2 in range(b):
    if c[ji2][b-ji2]==0:
        w+=1
    if w==b:
        o=1
for v1 in range(b):
    w=0
    for k in range(b):
        if c[k][v1]==0:
            w+=1
        if w==b:
            o=1

if o==1:
    print("Yes")
else:
    print("No")

a=list(map(int,input().split()))
b=len(a)
c=[a]
w=0
for i in range(b-1):
    c.append(list(map(int,input().split())))
N=int(input())
d=[]
for y in range(N):
    d.append(int(input()))
for n in d:
    for p in c:
        for j in p:
            if n in j:
                j=0
for t in c:
    for h in t:
        if c.count(0)==b:
            o=1
            break
    else:
        continue
    break
for v in range(b):
    w=0
    for k in c:
        if k[v]==0:
            w+=1
        if w==b:
            o=1
w=0
for ji in range(b):
    if c[ji][ji]==0:
        w+=1
    if w==b:
        o=1
w=0
for ji2 in range(b):
    if c[ji2][b-ji2]==0:
        w+=1
    if w==b:
        o=1
if o==1:
    print("Yes")
else:
    print("No")

p1=list(map(int,input().split()))
p2=list(map(int,input().split()))
p3=list(map(int,input().split()))
p=p1+p2+p3
n=int(input())
for _ in range(n):
    b=int(input())
    if b in p:
        p[p.index(b)]=0
if p[0]+p[1]+p[2]==0 or p[3]+p[4]+p[5]==0 or p[6]+p[7]+p[8]==0 or p[0]+p[3]+p[6]==0 or p[1]+p[4]+p[7]==0 or p[2]+p[5]+p[8]==0 or p[0]+p[4]+p[8]==0 or p[2]+p[4]+p[6]==0:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted