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):
        if A[j][0] == b:
            A[j][0] = 0
        if A[j][1] == b:
            A[j][1] = 0
        if A[j][2] == b:
            A[j][2] = 0

if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
    exit
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")
    exit
            
elif for k in range(3):
    if A[k][0]==A[k][1]==A[k][2]==0:
        print("Yes")
        exit
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
        exit

else:
    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):
        if A[j][0] == b:
            A[j][0] = 0
        if A[j][1] == b:
            A[j][1] = 0
        if A[j][2] == b:
            A[j][2] = 0

for k in range(3):
    if A[k][0]==a[k][1]==a[k][2]==0:
        print("Yes")
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
        exit
if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")
else:
    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):
        if A[j][0] == b:
            A[j][0] = 0
        if A[j][1] == b:
            A[j][1] = 0
        if A[j][2] == b:
            A[j][2] = 0

if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")     
elif for k in range(3):
    if A[k][0]==A[k][1]==A[k][2]==0:
        print("Yes")
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
else:
    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 l in range(3):
        if A[l][0] == b:
            A[l][0] = 0
        if A[l][1] == b:
            A[l][1] = 0
        if A[l][2] == b:
            A[l][2] = 0

if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")     
elif for k in range(3):
    if A[k][0]==A[k][1]==A[k][2]==0:
        print("Yes")
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
else:
    print("No")


n = int(input())

for j in range(n):
    b = int(input())
    for j in range(3):
        if A[j][0] == b:
            A[j][0] = 0
        if A[j][1] == b:
            A[j][1] = 0
        if A[j][2] == b:
            A[j][2] = 0

for k in range(3):
    if A[k][0]==A[k][1]==A[k][2]==0:
        print("Yes")
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
        exit
if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")
else:
    print("No")

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
n = int(input())

for i in range(n):
    b = int(input())
    for j in range(3):
        if A1[j] == b:
            A1[j] = 0
        if A2[j] == b:
            A2[j] = 0
        if A3[j] == b:
            A3[j] = 0

if A1[0]==A1[1]==A1[2]==0:
    print("Yes")
    exit
if A2[0]==A2[1]==A2[2]==0:
    print("Yes")
    exit
if A3[0]==A3[1]==A3[2]==0:
    print("Yes")
    exit

if A1[0]==A2[0]==A3[0]==0:
    print("Yes")
    exit
if A1[1]==A2[1]==A3[1]==0:
    print("Yes")
    exit
if A1[2]==A2[2]==A3[2]==0:
    print("Yes")
    exit
    
if A1[0]==A2[1]==A3[2]==0:
    print("Yes")
    exit
if A1[2]==A2[1]==A3[0]==0:
    print("Yes")
    exit
else:
    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):
        if A[j][0] == b:
            A[j][0] = 0
        if A[j][1] == b:
            A[j][1] = 0
        if A[j][2] == b:
            A[j][2] = 0

for k in range(3):
    if A[k][0]==a[k][1]==a[k][2]=0:
        print("Yes")
    elif A[0][k]==A[1][k]==A[2][k]==0:
        print("Yes")
        exit
if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")
else:
    print("No")

import sys
A = [list(map(int, input().split())) for i in range(3)]

n = int(input())

for j in range(n):
    b = int(input())
    for l in range(3):
        if A[l][0] == b:
            A[l][0] = 0
        if A[l][1] == b:
            A[l][1] = 0
        if A[l][2] == b:
            A[l][2] = 0
if A[0][0]==A[1][1]==A[2][2]==0:
    print("Yes")
    sys.exit()
elif A[0][2]==A[1][1]==A[2][0]==0:
    print("Yes")
    sys.exit()
elif A[0][0]==A[0][1]==A[0][2]==0:
    print("Yes")
    sys.exit()
elif A[1][0]==A[1][1]==A[1][2]==0:
    print("Yes")
    sys.exit()
elif A[2][0]==A[2][1]==A[2][2]==0:
    print("Yes")
    sys.exit()
elif A[0][0]==A[1][0]==A[2][0]==0:
    print("Yes")
    sys.exit()
elif A[0][1]==A[1][1]==A[2][1]==0:
    print("Yes")
    sys.exit()    
elif A[0][2]==A[1][2]==A[2][2]==0:
    print("Yes")
    sys.exit()   
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted