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):
#ABC157.B
A = list(map(int,input().split()))
N = int(input())
b = list(map(int,input().split()))

for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

#ABC157.B
A = [input().split()for i in range(3)]
N = int(input())
b = [int(input())for _ in range(N)]
if (A[0][0] in b)and (A[0][1]in b)and (A[0][2] in b):
    print('Yes')
elif (A[1][0]in b)and(A[1][1] in b)and(A[1][2]in b):
    print('Yes')
elif (A[2][0]in b)and(A[2][1]in b)and (A[2][2]in b):
    print('Yes')
elif (A[0][0]in b)and(A[1][0]in b)and(A[2][0]in b):
    print('Yes')
elif (A[0][1]in b)and (A[1][1]in b)and(A[2][1]in b):
    print('Yes')
elif (A[0][2] in b)and (A[1][2]in b)and(A[2][2]in b):
    print('Yes')
elif (A[0][0]in b)and (A[1][1]in b)and(A[2][2]in b):
    print('Yes')
elif (A[0][2]in b)and (A[1][1]in b)and(A[2][0]in b):
    print('Yes')
else:
    print('No')

#ABC157.B
A = list(input().split()for l in range(3))
N = int(input())
b = [int(input())for _ in range(N)]
for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

#ABC157.B
A = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

#ABC159.B
A = list(map(int,input().split()))
N = int(input())
b = list(map(int,input().split()))

for i in b:
    if i in A:
        A[A.index(i)]=0
if A[0]==0 and A[1]==0 and A[2]==0:
    print('Yes')
elif A[3]==0 and A[4]==0 and A[5]==0:
    print('Yes')
elif A[6]==0 and A[7]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[3]==0 and A[6]==0:
    print('Yes')
elif A[1]==0 and A[4]==0 and A[7]==0:
    print('Yes')
elif A[2]==0 and A[5]==0 and A[8]==0:
    print('Yes')

elif A[0]==0 and A[4]==0 and A[8]==0:
    print('Yes')
elif A[2]==0 and A[4]==0 and A[6]==0:
    print('Yes')
else:
    print('No')

#ABC157.B
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [int(input())for _ in range(N)]
if (A1[0] in b)and (A1[1]in b)and (A1[2] in b):
    print('Yes')
elif (A2[0]in b)and(A2[1] in b)and(A2[2]in b):
    print('Yes')
elif (A3[0]in b)and(A3[1]in b)and (A3[2]in b):
    print('Yes')
elif (A1[0]in b)and(A2[0]in b)and(A3[0]in b):
    print('Yes')
elif (A1[1]in b)and (A2[1]in b)and(A3[1]in b):
    print('Yes')
elif (A1[2] in b)and (A2[2]in b)and(A3[2]in b):
    print('Yes')
elif (A1[0]in b)and (A2[1]in b)and(A3[2]in b):
    print('Yes')
elif (A1[2]in b)and (A2[1]in b)and(A3[0]in b):
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted