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):
s = input().split()
nums = []
[[nums.append(num) for num in row.split(" ")] for row in s[:9]]
n = int(s[9])
bs = s[10:]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")


s = input().split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
pattterns = [[1, 2, 3],
             [1, 5, 9],
             [1, 4, 7],
             [2, 5, 8],
             [3, 5, 7],
             [3, 6, 9],
             [4, 5, 6],
             [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

import sys
input = sys.stdin.readline
s = input.split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
pattterns = [[1, 2, 3],
                [1, 5, 9],
                [1, 4, 7],
                [2, 5, 8],
                [3, 5, 7],
                [3, 6, 9],
                [4, 5, 6],
                [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

s = input().split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
patterns = [[1, 2, 3],
            [1, 5, 9],
            [1, 4, 7],
            [2, 5, 8],
            [3, 5, 7],
            [3, 6, 9],
            [4, 5, 6],
            [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")


s = []
a = [[s.append(i) for i in line.split(" ")] for line in input().split()]
nums = []
[[nums.append(num) for num in row.split(" ")] for row in s[:9]]
n = int(s[9])
bs = s[10:]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")


import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
    else:
        print("No")


import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
        sys.exit()
print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted