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):
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)]
con1 = A1[0] and A1[1] and A1[2]
con2 = A2[0] and A2[1] and A2[2]
con3 = A3[0] and A3[1] and A3[2]
con4 = A1[0] and A2[0] and A3[0]
con5 = A1[1] and A2[1] and A3[1]
con6 = A1[2] and A2[2] and A3[2]
con7 = A1[0] and A2[1] and A3[2]
con8 = A1[2] and A2[1] and A3[0]
if (con1 or con2 or con3 or con4 or con5 or con6 or con7 or con8) in B:
    print("Yes")
else:
    print("No")



A11, A12, A13 = map(int, input().split())
A21, A22, A23 = map(int, input().split())
A31, A32, A33 = map(int, input().split())
N = int(input())
B = {int(input()) for _ in range(N)}

h1 = {A11, A12, A13}
h2 = {A21, A22, A23}
h3 = {A31, A32, A33}
v1 = {A11, A21, A31}
v2 = {A12, A22, A32}
v3 = {A13, A23, A33}
c1 = {A11, A22, A33}
c2 = {A13, A22, A31}

if len(h1 & B)==3 or len(h2 & B)==3 or len(h3 & B)==3 or len(v1 & B)==3 or len(v2 & B)==3 or len(v3 & B)==3 or (c1 & B)==3 or len(c2 & B)==3:
    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())
B = [int(input()) for _ in range(N)]

con1 = A1[0] in B and A1[1] in B and A1[2] in B
con2 = A2[0]in B and A2[1]in B and A2[2]
con3 = A3[0]in B and A3[1]in B and A3[2]
con4 = A1[0]in B and A2[0]in B and A3[0]
con5 = A1[1]in B and A2[1]in B and A3[1]
con6 = A1[2]in B and A2[2]in B and A3[2]
con7 = A1[0]in B and A2[1]in B and A3[2]
con8 = A1[2]in B and A2[1]in B and A3[0]


if (con1 or con2 or con3 or con4 or con5 or con6 or con7 or con8) in B:
    print("Yes")
else:
    print("No")


A11, A12, A13 = map(int, input().split())
A21, A22, A23 = map(int, input().split())
A31, A32, A33 = map(int, input().split())
N = int(input())
B = [int(input()) for _ in range(N)]

h1 = [A11, A12, A13]
h2 = [A21, A22, A23]
h3 = [A31, A32, A33]
v1 = [A11, A21, A31]
v2 = [A12, A22, A32]
v3 = [A13, A23, A33]
c1 = [A11, A22, A33]
c2 = [A13, A22, A31]

print(h3 >= B)
print(h3)
print(B)


if h1 >= B or h2 >= B or h3 >= B or v1 >= B or v2 >= B or v3 >= B or c1 >= B or c2 >= B:
    print("Yes")
else:
    print("No")


A11, A12, A13 = map(int, input().split())
A21, A22, A23 = map(int, input().split())
A31, A32, A33 = map(int, input().split())
N = int(input())
B = {int(input()) for _ in range(N)}

h1 = {A11, A12, A13}
h2 = {A21, A22, A23}
h3 = {A31, A32, A33}
v1 = {A11, A21, A31}
v2 = {A12, A22, A32}
v3 = {A13, A23, A33}
c1 = {A11, A22, A33}
c2 = {A13, A22, A31}

if len(h1 & B)==3 or len(h2 & B)==3 or len(h3 & B)==3 or len(v1 & B)==3 or len(v2 & B)==3 or len(v3 & B)==3 or len(c1 & B)==3 or len(c2 & B)==3:
    print("Yes")
else:
    print("No")



Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted