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):
rows = []
for i in range(3):
    row = [int(x) for x in input().split()]
    rows.append(row)


columns = []
for k in range(3):
    column = [rows[l][k] for l in range(3)]
    columns.append(column)

left = []
for m in range(3):
    left.append(rows[m][m])

right = []
for n in range(3):
    for o in range(3)[::-1]:
        right.append(rows[n][o])

N = int(input())
choice = []
for j in range(N):
    choice.append(int(input()))


matches = []
for row in rows:
    matches.append([c for c in choice if c in row])

for column in columns:
    matches.append([c for c in choice if c in column])

matches.append([c for c in choice if c in left])
matches.append([c for c in choice if c in right])


for match in matches:
    if (len(matches) == 3):
        print("Yes")
else:
    print("No")


rows = []
for i in range(2):
    row = [int(x) for x in input().split()]
    rows.append(row)

N = int(input())
choice = []
for j in range(N):
    choice.append(int(input()))


for row in rows:
    match = [c for c in choice if c in row]

    if (len(match) >= 3):
        print("yes")
        break

columns = []
for k in range(3):
    column = [rows[l][k] for l in range(3)]
    columns.append(column)

for column in columns:
    match = [c for c in choice if c in column]

    if (len(match) >= 3):
        print("yes")
        break

left = []
for m in range(3):
    left.append(rows[m][m])

for x in left:
    match = [c for c in choice if c in x]

    if (len(match) >= 3):
        print("yes")
        break

right = []
for n in range(3):
    for o in range(3)[::-1]:
        right.append(rows[n][o])

for y in right:
    match = [c for c in choice if c in y]

    if (len(match) >= 3):
        print("yes")
        break


rows = []
for i in range(3):
    row = [int(x) for x in input().split()]
    rows.append(row)

N = int(input())
choice = []
for j in range(N):
    choice.append(int(input()))


for row in rows:
    match = [c for c in choice if c in row]

    if (len(match) >= 3):
        print("yes")
        break

columns = []
for k in range(3):
    column = [rows[l][k] for l in range(3)]
    columns.append(column)

for column in columns:
    match = [c for c in choice if c in column]

    if (len(match) >= 3):
        print("yes")
        break

left = []
for m in range(3):
    left.append(rows[m][m])

right = []
for n in range(3):
    for o in range(3)[::-1]:
        right.append(rows[n][o])

match_left = [c for c in choice if c in left]
match_right = [c for c in choice if c in right]

if (len(match_left) >= 3):
    print("yes")
elif (len(match_right) >= 3):
    print("yes")
else:
    print("no")


rows = []
for i in range(3):
    row = [int(x) for x in input().split()]
    rows.append(row)


columns = []
for k in range(3):
    column = [rows[l][k] for l in range(3)]
    columns.append(column)

left = []
for m in range(3):
    left.append(rows[m][m])

right = []
for n in range(3):
    for o in range(3)[::-1]:
        right.append(rows[n][o])

N = int(input())
choice = []
for j in range(N):
    choice.append(int(input()))


matches = []
for row in rows:
    matches.append([c for c in choice if c in row])

for column in columns:
    matches.append([c for c in choice if c in column])

matches.append([c for c in choice if c in left])
matches.append([c for c in choice if c in right])


for match in matches:
    if (len(matches) == 3):
        print("Yes")
        break
else:
    print("No")


rows = []
for i in range(3):
    row = [int(x) for x in input().split()]
    rows.append(row)


columns = []
for k in range(3):
    column = [rows[l][k] for l in range(3)]
    columns.append(column)

left = []
for m in range(3):
    left.append(rows[m][m])

right = []
o = 2
for n in range(3):
    right.append(rows[n][o])
    o -= 1


N = int(input())
choice = []
for j in range(N):
    choice.append(int(input()))


matches = []
for row in rows:
    matches.append([c for c in row if c in choice])

for column in columns:
    matches.append([c for c in column if c in choice])

matches.append([c for c in left if c in choice])
matches.append([c for c in right if c in choice])


isPrinted = False
for match in matches:
    if (len(match) == 3):
        print("Yes")
        isPrinted = True
        break

if (not isPrinted):
    print("No")


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted