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,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = []
for i in range(n):
    A.append(int(input()))
if ((a in A) and (b in A) and (c in A)) or ( d in A and e in A and f in A) or(g in A and h in A and i in A) or (a in A and d in A and g in A) or (b in A and e in A and h in A) or(c in A and f in A and i in A) or ( a in A and e in A and i in A) or(c in A and e in A and g in A):


    print("Yes")
else:
    print("No")

a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = [input() for _ in range(n)]
if (a and b and c) in A:
    print("Yes")
elif (d and e and f) in A:
    print("Yes")
elif (g and h and i) in A:
    print("Yes")
elif (a and d and g) in A:
    print("Yes")
elif (b and e and h) in A:
    print("Yes")
elif (c and f and i) in A:
    print("Yes")
elif (a and e and i) in A:
    print("Yes")
elif (c and e and g) in A:
    print("Yes")
else:
    print("No")

a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = []
for i in range(n):
    A.append(int(input()))
if (a in A) and (b in A) and (c in A):
    print("Yes")
elif d in A and e in A and f in A:
    print("Yes")
elif g in A and h in A and i in A:
    print("Yes")
elif a in A and d in A and g in A:
    print("Yes")
elif b in A and e in A and h in A:
    print("Yes")
elif c in A and f in A and i in A:
    print("Yes")
elif a in A and e in A and i in A:
    print("Yes")
elif c in A and e in A and g in A:
    print("Yes")
else:
    print("No")

a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = list(map(int, input().split()))
if (a and b and c) in A:
    print("Yes")
elif (d and e and f) in A:
    print("Yes")
elif (g and h and i) in A:
    print("Yes")
elif (a and d and g) in A:
    print("Yes")
elif (b and e and h) in A:
    print("Yes")
elif (c and f and i) in A:
    print("Yes")
elif (a and e and i) in A:
    print("Yes")
elif (c and e and g) in A:
    print("Yes")
else:
    print("No")

a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = []
for _ in range(n):
    A.append(int(input())
if (a and b and c) in A:
    print("Yes")
elif (d and e and f) in A:
    print("Yes")
elif (g and h and i) in A:
    print("Yes")
elif (a and d and g) in A:
    print("Yes")
elif (b and e and h) in A:
    print("Yes")
elif (c and f and i) in A:
    print("Yes")
elif (a and e and i) in A:
    print("Yes")
elif (c and e and g) in A:
    print("Yes")
else:
    print("No")

a,b,c  = map(int, input().split())
d,e,f  = map(int, input().split())
g,h,i  = map(int, input().split())
n=int(input())
A = []
for j in range(n):
    A.append(int(input()))
if (a in A) and (b in A) and (c in A):
    print("Yes")
elif d in A and e in A and f in A:
    print("Yes")
elif g in A and h in A and i in A:
    print("Yes")
elif a in A and d in A and g in A:
    print("Yes")
elif b in A and e in A and h in A:
    print("Yes")
elif c in A and f in A and i in A:
    print("Yes")
elif a in A and e in A and i in A:
    print("Yes")
elif c in A and e in A and g in A:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted