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_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))
N = int(input())
d_list = [int(input()) for k in range(N)]

for n in range(3):
    for p in range(3):
        if d_list[n] == a_list[p]:
            a_list[p] = 555
    for q in range(3):
        if d_list[n] == b_list[q]:
            b_list[q] = 555
    for r in range(3):
        if d_list[n] == c_list[r]:
            c_list[r] = 555

if a_list[0] == a_list[1] == a_list[2]:
    print('Yes')

elif b_list[0] == b_list[1] == b_list[2]:
    print('Yes')

elif c_list[0] == c_list[1] == c_list[2]:
    print('Yes')

elif a_list[0] == b_list[0] == c_list[0]:
        print('Yes')
elif a_list[1] == b_list[1] == c_list[1]:
        print('Yes')
elif a_list[2] == b_list[2] == c_list[2]:
    print('Yes')
elif a_list[0] == b_list[1] == c_list[2]:
    print('Yes')

elif a_list[2] == b_list[1] == c_list[0]:
    print('Yes')
else:
    print('No')

   

a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))
N = int(input())
d_list = [int(input()) for k in range(N)]


for n in range(3):
    for p in range(3):
        if d_list[n] == a_list[p]:
            a_list[p] = 555
    for q in range(3):
        if d_list[n] == b_list[q]:
            b_list[q] = 555
    for r in range(3):
        if d_list[n] == c_list[r]:
            c_list[r] = 555

if a_list[0] == a_list[1] == a_list[2] == 555:
    print('Yes')

elif b_list[0] == b_list[1] == b_list[2] == 555:
    print('Yes')

elif c_list[0] == c_list[1] == c_list[2] == 555:
    print('Yes')

elif a_list[0] == b_list[0] == c_list[0] == 555:
        print('Yes')
elif a_list[1] == b_list[1] == c_list[1] == 555:
        print('Yes')
elif a_list[2] == b_list[2] == c_list[2] == 555:
    print('Yes')
elif a_list[0] == b_list[1] == c_list[2] == 555:
    print('Yes')

elif a_list[2] == b_list[1] == c_list[0] == 555:
    print('Yes')
else:
    print('No')


a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))
N = int(input())
d_list = [int(input()) for k in range(N)]


for n in range(N):
    for p in range(3):
        if d_list[n] == a_list[p]:
            a_list[p] = 555
    for q in range(3):
        if d_list[n] == b_list[q]:
            b_list[q] = 555
    for r in range(3):
        if d_list[n] == c_list[r]:
            c_list[r] = 555

if a_list[0] == a_list[1] == a_list[2] == 555:
    print('Yes')

elif b_list[0] == b_list[1] == b_list[2] == 555:
    print('Yes')

elif c_list[0] == c_list[1] == c_list[2] == 555:
    print('Yes')

elif a_list[0] == b_list[0] == c_list[0] == 555:
        print('Yes')
elif a_list[1] == b_list[1] == c_list[1] == 555:
        print('Yes')
elif a_list[2] == b_list[2] == c_list[2] == 555:
    print('Yes')
elif a_list[0] == b_list[1] == c_list[2] == 555:
    print('Yes')

elif a_list[2] == b_list[1] == c_list[0] == 555:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Wrong Answer

Accepted