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 = [map(int,input().split()) for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[0][1],a[1][1],a[2][1]]
a8 = [a[0][2],a[1][2],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= set(B) or set(a2) <= set(B) or set(a3) <= set(B) or set(a4) <= set(B) or set(a5) <= set(B) or set(a6) <= set(B) or set(a7) <= set(B) or set(a8) <= set(B):
    print('Yes')
else:
    print('No')

a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[0][1],a[1][1],a[2][1]]
a8 = [a[0][2],a[1][2],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= set(B) or set(a2) <= set(B) or set(a3) <= set(B) or set(a4) <= set(B) or set(a5) <= set(B) or set(a6) <= set(B) or set(a7) <= set(B) or set(a8) <= set(B):
    print('Yes')
else:
    print('No')

a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[1][0],a[1][1],a[2][1]]
a8 = [a[2][0],a[2][1],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= set(B) or set(a2) <= set(B) or set(a3) <= set(B) or set(a4) <= set(B) or set(a5) <= set(B) or set(a6) <= set(B) or set(a7) <= set(B) or set(a8) <= set(B):
    print('Yes')
else:
    print('No')

a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
a4 = set()
a5 = set()
a4.update({a1[0],a2[1],a3[2]})
a5.update({a1[2],a2[1],a3[0]})
print(a4)
print(a5)
n = int(input())
B =set()
for i in range(n):
    b = int(input())
    B.add(b)
if set(a1) <= B or set(a2) <= B or set(a3) <= B or a4 <= B or a5 <= B:
    print('Yes')
else:
    print('No')

a = [input().split() for a in range(3)]
a1 = [a[0][0],a[0][1],a[0][2]]
a2 = [a[1][0],a[1][1],a[1][2]]
a3 = [a[2][0],a[2][1],a[2][2]]
a4 = [a[0][0],a[1][1],a[2][2]]
a5 = [a[0][2],a[1][1],a[2][0]]
a6 = [a[0][0],a[1][0],a[2][0]]
a7 = [a[1][0],a[1][1],a[2][1]]
a8 = [a[2][0],a[2][1],a[2][2]]
n = int(input())
B = [int(input()) for i in range(n)]
if set(a1) <= B or set(a2) <= B or set(a3) <= B or set(a4) <= B or set(a5) <= B or set(a6) <= B or set(a7) <= B or set(a8) <= B:
    print('Yes')
else:
    print('No')

a = [input().split() for a in range(3)]
n = int(input())
b = [input() for i in range(n)]
c = [a[0][0],a[1][1],a[2][2]]
d = [a[0][2],a[1][1],a[2][0]]
tate1 = len(set(a[0]) & set(b))
tate2 = len(set(a[1]) & set(b))
tate3 = len(set(a[2]) & set(b))
yoko1 = len(set([x[0] for x in a]) & set(b))
yoko2 = len(set([x[1] for x in a]) & set(b))
yoko3 = len(set([x[2] for x in a]) & set(b))
naname1 = len(set(c) & set(b))
naname2 = len(set(d) & set(b))
bingo = [tate1,tate2,tate3,yoko1,yoko2,yoko3,naname1,naname2]
if 3 in bingo:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted