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):
A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11, A12, A13 in b:
    print('Yes')
elif A21, A22, A23 in b:
    print('Yes')
elif A31, A32, A33 in b:
    print('Yes')
elif A11, A21, A31 in b:
    print('Yes')
elif A12, A22, A32 in b:
    print('Yes')
elif A13, A23, A33 in b:
    print('Yes')
elif A11, A22, A33 in b:
    print('Yes')
elif A13, A22, A31 in b:
    print('Yes')
else:
    print('No')

A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11 in b and A12 in b and A13 in b:
    print('Yes')
elif A21 in b and A22 in b and A23 in b:
    print('Yes')
elif A31 in b and A32 in b and A33 in b:
    print('Yes')
elif A11 in b and A21 in b and A31 in b:
    print('Yes')
elif A12 in b and A22 in b and A32 in b:
    print('Yes')
elif A13 in b and A23 in b and A33 in b:
    print('Yes')
elif A11 in b and A22 in b and A33 in b:
    print('Yes')
elif A13 in b and A22 in b and A31 in b:
    print('Yes')
else:
    print('No')

A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11 in b and A12 in b and A13 in b:
    print('Yes')
elif A21 in b and A22 in b and A23 in b:
    print('Yes')
elif A31 in b and A32 in b and A33 in b:
    print('Yes')
elif A11 in b and A21 in b and A31 in b:
    print('Yes')
elif A12 in b and A22 in b and A32 in b:
    print('Yes')
elif A13 in b and A23 in b and A33 in b:
    print('Yes')
elif in b A11 and A22 in b and A33 in b:
    print('Yes')
elif A13 in b and A22 in b and A31 in b:
    print('Yes')
else:
  print('No')

A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11 and A12 and A13 in b:
    print('Yes')
elif A21 and A22 and A23 in b:
    print('Yes')
elif A31 and A32 and A33 in b:
    print('Yes')
elif A11 and A21 and A31 in b:
    print('Yes')
elif A12 and A22 and A32 in b:
    print('Yes')
elif A13 and A23 and A33 in b:
    print('Yes')
elif A11 and A22 and A33 in b:
    print('Yes')
elif A13 and A22 and A31 in b:
    print('Yes')
else:
  print('No')

A11, A12, A13=list1(map(int,input().split()))
A21, A22, A23=list2(map(int,input().split()))
A31, A32, A33=list3(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11 and A12 and A13 in b:
    print('Yes')
elif A21 and A22 and A23 in b:
    print('Yes')
elif A31 and A32 and A33 in b:
    print('Yes')
elif A11 and A21 and A31 in b:
    print('Yes')
elif A12 and A22 and A32 in b:
    print('Yes')
elif A13 and A23 and A33 in b:
    print('Yes')
elif A11 and A22 and A33 in b:
    print('Yes')
elif A13 and A22 and A31 in b:
    print('Yes')
else:
  print('No')

A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[int(input()) for i in range(N)]
if A11 in b and A12 in b and A13 in b:
    print('Yes')
elif A21 in b and A22 in b and A23 in b:
    print('Yes')
elif A31 in b and A32 in b and A33 in b:
    print('Yes')
elif A11 in b and A21 in b and A31 in b:
    print('Yes')
elif A12 in b and A22 in b and A32 in b:
    print('Yes')
elif A13 in b and A23 in b and A33 in b:
    print('Yes')
elif A11 in b and A22 in b and A33 in b:
    print('Yes')
elif A13 in b and A22 in b and A31 in b:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted