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):
import sys

def main():
    a=[]
    b=[]
    c=[]
    for i in range(3):
        tmp = input().replace('\n','').split(' ')
        tmp = list(map(int, tmp))
        a.append([tmp[0],False])
        a.append([tmp[1],False])
        a.append([tmp[2],False])
        c.append(tmp[0])
        c.append(tmp[1])
        c.append(tmp[2])
    n = int(input().replace('\n',''))
    for i in range(n):
        try:
            tmp = c.index(int(input().replace('\n','')))
            a[tmp][1] = True
        except ValueError:
            pass
    for i in range(3):
        if a[i][1] and a[i+3][1] and a[i+6][1]:
            res = 'Yes'
            break
        elif a[i*3][1] and a[i*3+1][1] and a[i*3+2][1]:
            res = 'Yes'
            break
        elif a[0][1] and a[4][1] and a[7][1] or a[2][1] and a[4][1] and a[6][1]:
            res = 'Yes'
            break
        else:
            res = 'No'
            break
    print(res)
if __name__ == '__main__':
    input = sys.stdin.readline
    main()

import sys

def main():
    a=[]
    b=[]
    c=[]
    for i in range(3):
        tmp = input().replace('\n','').split(' ')
        tmp = list(map(int, tmp))
        a.append([tmp[0],False])
        a.append([tmp[1],False])
        a.append([tmp[2],False])
        c.append(tmp[0])
        c.append(tmp[1])
        c.append(tmp[2])
    n = int(input().replace('\n',''))
    for i in range(n):
        try:
            tmp = c.index(int(input().replace('\n','')))
            a[tmp][1] = True
        except ValueError:
            pass
    for i in range(3):
        if a[i][1] and a[i+3][1] and a[i+6][1]:
            res = 'Yes'
            break
        elif a[i*3][1] and a[i*3+1][1] and a[i*3+2][1]:
            res = 'Yes'
            break
        elif a[0][1] and a[4][1] and a[7][1] or a[2][1] and a[4][1] and a[6][1]:
            res = 'Yes'
            break
        else:
            res = 'No'
    print(res)
if __name__ == '__main__':
    input = sys.stdin.readline
    main()

import sys

def main():
    a=[]
    b=[]
    c=[]
    for i in range(3):
        tmp = input().replace('\n','').split(' ')
        tmp = list(map(int, tmp))
        a.append([tmp[0],False])
        a.append([tmp[1],False])
        a.append([tmp[2],False])
        c.append(tmp[0])
        c.append(tmp[1])
        c.append(tmp[2])
    n = int(input().replace('\n',''))
    for i in range(n):
        try:
            tmp = c.index(int(input().replace('\n','')))
            a[tmp][1] = True
        except ValueError:
            pass
    for i in range(3):
        if a[i][1] and a[i+3][1] and a[i+6][1]:
            res = 'Yes'
            break
        elif a[i*3][1] and a[i*3+1][1] and a[i*3+2][1]:
            res = 'Yes'
            break
        elif a[0][1] and a[4][1] and a[8][1] or a[2][1] and a[4][1] and a[6][1]:
            res = 'Yes'
            break
        else:
            res = 'No'
    print(res)
if __name__ == '__main__':
    input = sys.stdin.readline
    main()

Verdicts: Wrong Answer

Wrong Answer

Accepted