TnT/Multi_CodeNet4Repair huggingface dataset:
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):
row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))

n = int(input())
nums = []
ans = "No"

for i in range(0, n):
  nums.append(int(input()))
  
for i in range(0,3):
  if row1[i] in nums: row1[i] == "O"
  if row2[i] in nums: row2[i] == "O"
  if row3[i] in nums: row3[i] == "O"
    
#Columns
for i in range(0,3):
  if row1[i] == row2[i] == row3[i]: ans = "Yes"
    
#Rows
if row1 == ["O","O","O"] or row2 == ["O","O","O"] or row3 == ["O","O","O"]: ans = "Yes"
  
#Diagonals
if row1[0] == row2[1] == row3[2] or row1[2] == row2[1] == row3[0]: ans = "Yes"
  
print(ans)

row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))

n = int(input())
nums = []
ans = "No"

for i in range(0, n):
  nums.append(int(input()))

for i in range(0,3):
  if row1[i] in nums: row1[i] == "O"
  if row2[i] in nums: row2[i] == "O"
  if row3[i] in nums: row3[i] == "O"

#Columns
for i in range(0,3):
  if row1[i] == row2[i] == row3[i]: ans = "Yes"
    
#Rows
if row1 == ["O","O","O"] or row2 == ["O","O","O"] or row3 == ["O","O","O"]: ans = "Yes"
  
#Diagonals
if row1[0] == row2[1] == row3[2] or row1[2] == row2[1] == row3[0]: ans = "Yes"
  
print(ans)


row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))

n = int(input())
nums = []
ans = "No"


for i in range(0, n):
  nums.append(int(input()))

for i in range(0,3):
  if row1[i] in nums: row1[i] = "O"
  if row2[i] in nums: row2[i] = "O"
  if row3[i] in nums: row3[i] = "O"

#Columns
for i in range(0,3):
  if row1[i] == row2[i] == row3[i]: ans = "Yes"
    
#Rows
if row1 == ["O","O","O"] or row2 == ["O","O","O"] or row3 == ["O","O","O"]: ans = "Yes"
  
#Diagonals
if row1[0] == row2[1] == row3[2] or row1[2] == row2[1] == row3[0]: ans = "Yes"
  
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
#Bingo
card = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for _ in range(N)]
a = [[0]*3 for _ in range(3)]
for bi in b:
    for i in range(3):
        for j in raneg(3):
            if bi == card[i][j]:
                a[i][j] = 1
                
ans = 'No'
#tate
for i in range(3):
    if a[0][i] == 1 and a[1][i] == 1 and a[2][i] == 1:
        ans = 'Yes'
            
#yoko
for i in range(3):
    if a[i][0] == 1 and a[i][1] == 1 and a[i][2] == 1:
        ans = 'Yes'
    
#naname
if a[0][0] == 1 and a[1][1] == 1 and a[2][2] == 1:
    ans = 'Yes'
if a[1][3] == 1 and a[2][2] == 1 and a[3][1] == 1:
    ans ='Yes'
print(ans)

#Bingo
card = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = list([int(input()) for _ in range(N)])
a = [[0]*3 for _ in range(3)]
for bi in b:
    for i in range(3):
        for j in range(3):
            if bi == card[i][j]:
                a[i][j] = 1
                
ans = 'No'
#tate
for i in range(3):
    if a[0][i] == 1 and a[1][i] == 1 and a[2][i] == 1:
        ans = 'Yes'
            
#yoko
for i in range(3):
    if a[i][0] == 1 and a[i][1] == 1 and a[i][2] == 1:
        ans = 'Yes'
    
#naname
if a[0][0] == 1 and a[1][1] == 1 and a[2][2] == 1:
    ans = 'Yes'
if a[0][2] == 1 and a[1][1] == 1 and a[2][0] == 1:
    ans ='Yes'
print(ans)

Verdicts: Runtime Error

Accepted
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 numpy as np

a1 = list(map(int, input().split(' ')))
a2 = list(map(int, input().split(' ')))
a3 = list(map(int, input().split(' ')))
n = int(input())

nums = [int(input()) for _ in range(n)]

arr = np.array([a1, a2, a3])
mask = np.zeros_like(arr)

for num in nums:
    idx = np.where(arr == num)

    if len(idx[0]) == 0:
        pass
    else:
        mask[idx] = 1
    print(mask)

s_v = np.sum(mask, axis=0)
s_h = np.sum(mask, axis=0)
s_diag_1 = mask[0, 0] + mask[1, 1] + mask[2, 2]
s_diag_2 = mask[0, 2] + mask[1, 1] + mask[2, 0] 
s = np.maximum(np.concatenate([s_v, s_h, [s_diag_1], [s_diag_2]]) - 2, 0)

if np.max(s) > 0:
    print('Yes')
else:
    print('No')

import numpy as np

a1 = list(map(int, input().split(' ')))
a2 = list(map(int, input().split(' ')))
a3 = list(map(int, input().split(' ')))
n = int(input())

nums = [int(input()) for _ in range(n)]

arr = np.array([a1, a2, a3])
mask = np.zeros_like(arr)

for num in nums:
    idx = np.where(arr == num)

    if len(idx[0]) == 0:
        pass
    else:
        mask[idx] = 1

s_v = np.sum(mask, axis=0)
s_h = np.sum(mask, axis=1)
s_diag_1 = mask[0, 0] + mask[1, 1] + mask[2, 2]
s_diag_2 = mask[0, 2] + mask[1, 1] + mask[2, 0] 
s = np.maximum(np.concatenate([s_v, s_h, [s_diag_1], [s_diag_2]]) - 2, 0)

if np.max(s) > 0:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
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):
# ABC157b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    
    bing = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    for num in b:
        for i in bing:
            try:
                while True:
                    t = i.index(num)
                    i[t] = -1
            except:
                continue
    # print(bing)

    naname = [((0, 0), (1, 1), (2, 2)), (2, 0), (1, 1), (0, 2)]
    if sum(bing[0]) == -3 or sum(bing[1]) == -3 or sum(bing[2]) == -3 or bing[0][0]+bing[1][0]+bing[2][0] == -3 or bing[0][1]+bing[1][1]+bing[2][1] == -3 or bing[0][2]+bing[0][2]+bing[0][2] == -3 or bing[0][0]+bing[1][1]+bing[2][2] == -3 or bing[0][2]+bing[1][1]+bing[2][0] == -3:
        print('Yes')
        exit(0)

    print('No')

    d = [(1, 0), (1, 1), (0, 1)]
    for i in range(3):
        if sum(bing[i]) == -3:
            


if __name__ == '__main__':
    main()


# ABC157b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    
    bing = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    for num in b:
        for i in bing:
            try:
                while True:
                    t = i.index(num)
                    i[t] = -1
            except:
                continue
    # print(bing)

    naname = [((0, 0), (1, 1), (2, 2)), (2, 0), (1, 1), (0, 2)]
    if sum(bing[0]) == -3 or sum(bing[1]) == -3 or sum(bing[2]) == -3 or bing[0][0]+bing[1][0]+bing[2][0] == -3 or bing[0][1]+bing[1][1]+bing[2][1] == -3 or bing[0][2]+bing[1][2]+bing[2][2] == -3 or bing[0][0]+bing[1][1]+bing[2][2] == -3 or bing[0][2]+bing[1][1]+bing[2][0] == -3:
        print('Yes')
        exit(0)

    print('No')


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
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(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    b = int(input())
    for j in range(3):
        if b in a[j]:
            idx = a[j].index(b)
            a[j][idx] = 0
print(a)
for k in range(3):
    if sum(a[k]) == 0:  
        print('Yes')
        exit()
    elif a[0][k] + a[1][k] + a[2][k] == 0:
        print("Yes")
        exit()
if a[0][0] + a[1][1] + a[2][2] == 0 or a[0][2] + a[1][1] + a[2][0] == 0:
    print('Yes')
else:
    print('No')

import numpy as np


flag = False
arr = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    b = int(input())
    for j in range(3):
        if b in arr[j]:
            idx = arr[j].index(b)
            arr[j][idx] = 0

arr = np.array(arr)
for s in arr:
    if sum(s) == 0:
        flag = True
arr = np.rot90(arr)
for s in arr:
    if sum(s) == 0:
        flag = True
if arr[0][0] + arr[1][1] + arr[2][2] ==0:
    flag = True
if arr[2][0] + arr[1][1] + arr[0][2] == 0:
    flag = True
if flag:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
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):
ソースコード 

Copy
Copy
A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")

A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")
print(A)

A=[]
flag=0
for i in range(3):
  A.append(list(map(int,input().split())))
n=int(input())
for i in range(n):
  s=int(input())
  for k in range(3):
    if s in A[k]:
      A[k][A[k].index(s)]=0

if A[0]==[0,0,0] or A[1]==[0,0,0] or A[2]==[0,0,0]:
  print("Yes")
  flag=1
elif A[1][1]==0 and A[2][2]==0 and A[0][0]==0:
  print("Yes")
  flag=1
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  flag=1
else:
  for i in range(3):
    if A[0][i]==0 and A[1][i]==0 and A[2][i]==0:
      print("Yes")
      flag=1
      break
if flag == 0:
  print("No")

Verdicts: Runtime Error

Wrong Answer

Accepted
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):
bingo = [list(map(int,input().split())) for i in range(3)]
n = int(input())
num = [int(input()) for _ in range(n)]
print(bingo)

for i in range(3):
  for j in range(3):
    if bingo[i][j] in num:
      bingo[i][j] = 0
print(bingo)

for i in range(3):
  if bingo[i].count(0) == 3:
    print("Yes")
    exit()
  elif bingo[0][i] == 0 and bingo[1][i] == 0 and bingo[2][i] == 0:
    print("Yes")
    exit()
  else:
    pass

if bingo[0][0] == 0 and bingo[1][1] == 0 and bingo[2][2] ==0:
  print("Yes")
  exit()
elif bingo[0][2] == 0 and bingo[1][1] == 0 and bingo[2][0] == 0:
  print("Yes")
  exit()
else:
  print("No")


bingo = [list(map(int,input().split())) for i in range(3)]
n = int(input())
num = [int(input()) for _ in range(n)]

for i in range(3):
  for j in range(3):
    if bingo[i][j] in num:
      bingo[i][j] = 0

for i in range(3):
  if bingo[i].count(0) == 3:
    print("Yes")
    exit()
  elif bingo[0][i] == 0 and bingo[1][i] == 0 and bingo[2][i] == 0:
    print("Yes")
    exit()
  else:
    pass

if bingo[0][0] == 0 and bingo[1][1] == 0 and bingo[2][2] ==0:
  print("Yes")
  exit()
elif bingo[0][2] == 0 and bingo[1][1] == 0 and bingo[2][0] == 0:
  print("Yes")
  exit()
else:
  print("No")


Verdicts: Wrong Answer

Accepted
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):
# input
A = []
A_append = A.append
for i in range(3):
    An = list(map(int, input().split()))
    A_append(An)
print(A)

N = int(input())

b = []
append = b.append
for i in range(N):
    bn = int(input())
    append(bn)



marker = [[0 * 3], [0 * 3], [0 * 3]]
bingo_fl = False
for i in b:
    if b in A:
        n, m = A.index(b)
        marker[n][m] = 1

        if (
            [1 * 3] in [marker[i][:] for i in range(3)] or
            [1 * 3] in [[marker[0][i], marker[1][i], marker[2][i]] for i in range(3)] or
            [1 * 3] == [marker[0][0], marker[1][1], marker[2][2]] or
            [1 * 3] == [marker[0][2], marker[1][1], marker[2][0]]
        ):
            bingo_fl = True
            break

if bingo_fl is True:
    print("Yes")
else:
    print("No")

# input
A = []
A_append = A.append
for i in range(3):
    An = list(map(int, input().split()))
    A_append(An)

N = int(input())

b = []
append = b.append
for i in range(N):
    bn = int(input())
    append(bn)



marker = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

bingo_fl = False
for i in b:
    for n, An in enumerate(A):

        if i in An:
            m = An.index(i)

            marker[n][m] = 1

            break

if (
        [1, 1, 1] in [marker[i][:] for i in range(3)] or
        [1, 1, 1] in [[marker[0][i], marker[1][i], marker[2][i]] for i in range(3)] or
        [1, 1, 1] == [marker[0][0], marker[1][1], marker[2][2]] or
        [1, 1, 1] == [marker[0][2], marker[1][1], marker[2][0]]
):
    bingo_fl = True

if bingo_fl is True:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
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):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
bingomap = [[0,0,0],[0,0,0],[0,0,0]]
print(A)
N = int(input())
b = list()
ret = 'No'
for i in range(N):
  b.append(int(input()))
  print(b)
  for i in range(N):
    for j in range(3):
      if b[i] in A[j]:
        bingomap[j][A[j].index(b[i])] = 1
        break
    if i >= 2 :
      if checkbingo(bingomap) == True:
        ret = 'Yes'
        break
print(ret)

def checkbingo(map_):
  for i in range(3):
    if map_[i][0] * map_[i][1] * map_[i][2] == 1:
      return True
    if map_[0][i] * map_[0][i] * map_[0][i] == 1:
      return True
  if map_[0][0] * map_[1][1] * map_[2][2] == 1:
    return True
  if map_[0][2] * map_[1][1] * map_[2][0] == 1:
    return True
  return False 

def checkbingo(map_):
  for i in range(3):
    if map_[i][0] * map_[i][1] * map_[i][2] == 1:
      return True
    if map_[0][i] * map_[1][i] * map_[2][i] == 1:
      return True
  if map_[0][0] * map_[1][1] * map_[2][2] == 1:
    return True
  if map_[0][2] * map_[1][1] * map_[2][0] == 1:
    return True
  return False 

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
bingomap = [[0,0,0],[0,0,0],[0,0,0]]
N = int(input())
b = list()
ret = 'No'
for i in range(N):
  b.append(int(input()))
for i in range(N):
  for j in range(3):
    if b[i] in A[j]:
      bingomap[j][A[j].index(b[i])] = 1
      break
  if i >= 2 :
    if checkbingo(bingomap) == True:
      ret = 'Yes'
      break
print(ret)

Verdicts: Runtime Error

Accepted
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):
l=[[]]*3
for k in range(3):
  l[k]=list(map(int,input().split()))
n=int(input())
ll=[[0,0,0]]*3
for k in range(n):
  i=int(input())
  for j in range(3):
    if i in l[j]:
      ll[j][l.index(i)]=1
a=0
if ll[0][0]==1:
  if ll[0][1]==1 and ll[0][2]==1:
    print("Yes")
    a=1
  elif ll[1][1]==1 and ll[2][2]==1:
    print("Yes")
    a=1
  elif ll[1][0]==1 and ll[2][0]==1:
    print("Yes")
    a=1
elif ll[0][1]==1 and ll[1][1]==1 and ll[2][1]==1:
  print("Yes")
  a=1
elif ll[0][2]==1:
  if ll[1][1]==1 and ll[2][0]==1:
    print("Yes")
    a=1
  elif ll[1][2]==1 and ll[2][2]==1:
    print("Yes")
    a=1
elif ll[1][0]==1:
  if ll[1][1]==1 and ll[1][2]==1:
    print("Yes")
    a=1
elif ll[2][0]==1:
  if ll[2][1]==1 and ll[2][2]==1:
    print("Yes")
    a=1
if a==0:
  print("No")

l=[[]]*3
for k in range(3):
  l[k]=list(map(int,input().split()))
n=int(input())
ll=[[0]*3 for i in range(3)]
for k in range(n):
  i=int(input())
  for j in range(3):
    if i in l[j]:
      ll[j][l[j].index(i)]=1
a=0
if ll[0][0]==1:
  if ll[0][1]==1 and ll[0][2]==1:
    a=1
  if ll[1][1]==1 and ll[2][2]==1:
    a=1
  if ll[1][0]==1 and ll[2][0]==1:
    a=1
if ll[0][1]==1 and ll[1][1]==1 and ll[2][1]==1:
  a=1
if ll[0][2]==1:
  if ll[1][1]==1 and ll[2][0]==1:
    a=1
  if ll[1][2]==1 and ll[2][2]==1:
    a=1
if ll[1][0]==1:
  if ll[1][1]==1 and ll[1][2]==1:
    a=1
if ll[2][0]==1:
  if ll[2][1]==1 and ll[2][2]==1:
    a=1
if a==0:
  print("No")
else:
  print("Yes")


Verdicts: Runtime Error

Accepted
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(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]

for i in range(3):
    for j in range(3):
      for k in b:
        if k == a[i][j]:
          a[i][j] = 101
          break
      
if a[1] == [101,101,101] or a[2] == [101,101,101] or a[3] == [101,101,101]:
  print('Yes')
  exit()
elif (a[1][1]==101 and a[2][1] ==101 and a[3][1] == 101) or (a[1][2]==101 and a[2][2] ==101 and a[3][2] == 101) and (a[1][3]==101 and a[2][3] ==101 and a[3][3] == 101):
  print('Yes')
  exit()
elif (a[1][1]==101 and a[2][2] ==101 and a[3][3] == 101) or (a[1][3]==101 and a[2][2] ==101 and a[3][1] == 101):
  print('Yes')
  exit()
else:
  print('No')

a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
 
for i in b:
  for j in range(3):
    for k in range(3):
      if i == a[j][k]:
        a[j][k] = 0
        
for i in range(3):
  if sum(a[i]) == 0:
    print('Yes')
    exit()
    
if a[0][0]+a[1][0]+a[2][0] == 0 or a[0][1]+a[1][1]+a[2][1] == 0 or a[0][2]+a[1][2]+a[2][2] == 0:
  print('Yes')
elif a[0][0]+a[1][1]+a[2][2] == 0 or a[0][2]+a[1][1]+a[2][0] == 0:
  print('Yes')
else:
  print('No')
    

Verdicts: Runtime Error

Accepted
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):
for i in range(3):
    line = input().rstrip().split(' ')
    array_1.append(line)

bool_array = []
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(False)
    bool_array.append(tmp)
num = int(input().rstrip())
for i in range(num):
    input_line = input().rstrip()
    for j in range(3):
        for k in range(3):
            if array_1[j][k] == input_line:
                bool_array[j][k] = True

ans = "No"
for i in range(3):
    if bool_array[i][0] and bool_array[i][1] and bool_array[i][2]:
        ans = 'Yes'

    if bool_array[0][i] and bool_array[1][i] and bool_array[2][i]:
        ans = 'Yes'

if bool_array[0][0] and bool_array[1][1] and bool_array[2][2]:
    ans = 'Yes'

if bool_array[0][2] and bool_array[1][1] and bool_array[2][0]:
    ans = 'Yes'
print(ans)


array_1 = []
for i in range(3):
    line = input().rstrip().split(' ')
    array_1.append(line)

bool_array = []
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(False)
    bool_array.append(tmp)
num = int(input().rstrip())
for i in range(num):
    input_line = input().rstrip()
    for j in range(3):
        for k in range(3):
            if array_1[j][k] == input_line:
                bool_array[j][k] = True

ans = "No"
for i in range(3):
    if bool_array[i][0] and bool_array[i][1] and bool_array[i][2]:
        ans = 'Yes'

    if bool_array[0][i] and bool_array[1][i] and bool_array[2][i]:
        ans = 'Yes'

if bool_array[0][0] and bool_array[1][1] and bool_array[2][2]:
    ans = 'Yes'

if bool_array[0][2] and bool_array[1][1] and bool_array[2][0]:
    ans = 'Yes'
print(ans)


Verdicts: Runtime Error

Accepted
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):
60 88 34
92 41 43
65 73 48
10
60
43
88
11
48
73
65
41
92
34

row1 = input().split()
row2 = input().split()
row3 = input().split()

n = int(input())
nums = [input() for i in range(n)]

rows = [row1, row2, row3]

for i in range(0, 3):
    rows += [[row1[i], row2[i], row3[i]]]

rows += [[row1[0], row2[1], row3[2]]]
rows += [[row1[2], row2[1], row3[0]]]

print(rows)

for row in rows:
    j = 0
    for num in nums:
        if num in row:
            j += 1
        if j == 3:
            print('Yes')
            exit()

print('No')


one = list(map(int, input().split()))
two = list(map(int, input().split()))
three = list(map(int, input().split()))
n = int(input())
out = [int(input()) for x in range(n)]


def judge(a_list):
    for i in a_list:
        if i not in out:
            return False

    return True


for_judge = [one, two, three]

for i in range(3):
    tmp = [one[i], two[i], three[i]]
    for_judge.append(tmp)


naname1 = [one[0], two[1], three[2]]
naname2 = [one[2], two[1], three[0]]

for_judge.append(naname1)
for_judge.append(naname2)

for a_list in for_judge:
    if judge(a_list):
        print('Yes')
        exit()

print('No')


Verdicts: Runtime Error

Wrong Answer

Accepted
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):
li=[]
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
n=int(input())
for i in range(n):
  j=int(input())
  li.append(j)
bingo=0
yoko1=a and b and c in li
yoko2=d and e and f in li
yoko3=g and h and i in li
yoko=yoko1 or yoko2 or yoko3
tate1=a and d and g in li
tate2=b and e and h in li
tate3=c and f and i in li
tate=tate1 or tate2 or tate3
nana1=a and e and i in li
nana2=c and e and g in li
nana=nana1 or nana2
if yoko or tate or nana:
    bingo=1
print("Yes" if bingo==1 else "No")


li=[]
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
n=int(input())
for num in range(n):
  j=int(input())
  li.append(j)
bingo=0
yoko1=(a in li) and (b in li) and (c in li)
yoko2=(d in li) and (e in li) and (f in li)
yoko3=(g in li) and (h in li) and (i in li)
yoko=yoko1 or yoko2 or yoko3
tate1=(a in li) and (d in li) and (g in li)
tate2=(b in li) and (e in li) and (h in li)
tate3=(c in li) and (f in li) and (i in li)
tate=tate1 or tate2 or tate3
nana1=(a in li) and (e in li) and (i in li)
nana2=(c in li) and (e in li) and (g in li)
nana=nana1 or nana2
if yoko or tate or nana:
    bingo=1
print("Yes" if bingo==1 else "No")

Verdicts: Wrong Answer

Accepted
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(map(int,input().split())) for i in range(3)]
A_flat=[]
for i in range(len(A)):
    A_flat.append(A[i][0])
    A_flat.append(A[i][1])
    A_flat.append(A[i][2])

N = int(input())
b = [int(input()) for i in range(N)]
for i in range(len(b)):
    if b[i] in A_flat:
        index = A_flat.index(b[i])
        A_flat[index] = 0

 judge=False
for i in range(3):
    if A_flat[0+i] == A_flat[3+i] == A_flat[6+i]:
        print("Yes")
        judge = True
        break
    elif A_flat[0+i*3]==A_flat[1+i*3]==A_flat[2+i*3]:
        print("Yes")
        judge = True
        break
    elif A_flat[0]==A_flat[4]==A_flat[8] or A_flat[2]==A_flat[4]==A_flat[6]:
        print("Yes")
        judge = True
        break

if judge is False:
    print("No")


A = [list(map(int,input().split())) for i in range(3)]
A_flat=[]
for i in range(len(A)):
    A_flat.append(A[i][0])
    A_flat.append(A[i][1])
    A_flat.append(A[i][2])

N = int(input())
b = [int(input()) for i in range(N)]
for i in range(len(b)):
    if b[i] in A_flat:
        index = A_flat.index(b[i])
        A_flat[index] = 0

judge=False
for i in range(3):
    if A_flat[0+i] == A_flat[3+i] == A_flat[6+i]:
        print("Yes")
        judge = True
        break
    elif A_flat[0+i*3]==A_flat[1+i*3]==A_flat[2+i*3]:
        print("Yes")
        judge = True
        break
    elif A_flat[0]==A_flat[4]==A_flat[8] or A_flat[2]==A_flat[4]==A_flat[6]:
        print("Yes")
        judge = True
        break

if judge is False:
    print("No")


Verdicts: Runtime Error

Accepted
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 = []
for i in range(3):
    a.append([int(x) for x in input().split()])
bing = [([0]*3),([0]*3),([0]*3)]

N=int(input())
bs = [int(input()) for _ in range(N)]

for b in bs:
    for i in range(3):
        for j in range(3):
            if a[i][j]==b:
                bing[i][j]=1

def isbingo(board):
    for i in range(3):
        if sum(board[i])==3:
            return True
    for j in range(3):
        if sum([board[i][j] for i in range(3)])==3:
            return True
    if sum([board[0][0],board[1][1],board[2][2]])==3:
        return True
    if sum([board[0][2],board[1][1],board[2][0]])==3:
        return True
    return False
print(a)
print('Yes'if isbingo(bing) else 'No')

a = []
for i in range(3):
    a.append([int(x) for x in input().split()])
bing = [[0]*3,[0]*3,[0]*3]

N=int(input())
bs = [int(input()) for _ in range(N)]

for b in bs:
    for i in range(3):
        for j in range(3):
            if a[i][j]==b:
                bing[i][j]=1



def isbingo(board):
    for i in range(3):
        if sum(board[i])==3:
            return True
    for j in range(3):
        if sum([board[i][j] for i in range(3)])==3:
            return True
    if sum([board[0][0],board[1][1],board[2][2]])==3:
        return True
    if sum([board[0][2],board[1][1],board[2][0]])==3:
        return True
    return False
print('Yes'if isbingo(bing) else 'No')

Verdicts: Wrong Answer

Accepted
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):
A11,A12,A13 = map(int,input().split())
A21,A22,A23 = map(int,input().split())
A31,A32,A33 = map(int,input().split())

Alist = []
Alist.append(A11)
Alist.append(A12)
Alist.append(A13)
Alist.append(A21)
Alist.append(A22)
Alist.append(A23)
Alist.append(A31)
Alist.append(A32)
Alist.append(A33)
bingolist =[0]*9

N = int(input())
#print (N)
for i in range(N):
  b = int(input())
  print (b)
  for j in range(len(bingolist)):
    if b ==Alist[j]:
      bingolist[j] = 1

if sum(bingolist[0:3])==3 or sum(bingolist[3:6])==3 or sum(bingolist[6:9])==3 or (bingolist[0]+bingolist[3]+bingolist[6])==3 or (bingolist[1]+bingolist[4]+bingolist[7])==3 or (bingolist[2]+bingolist[5]+bingolist[8])==3 or (bingolist[0]+bingolist[4]+bingolist[8])==3 or (bingolist[2]+bingolist[4]+bingolist[6])==3:
  print ("Yes")
else :
  print ("No")
#print (bingolist[0:3])
#print (bingolist[3:6])
#print (bingolist[6:9])
#print (bingolist)

A11,A12,A13 = map(int,input().split())
A21,A22,A23 = map(int,input().split())
A31,A32,A33 = map(int,input().split())

Alist = []
Alist.append(A11)
Alist.append(A12)
Alist.append(A13)
Alist.append(A21)
Alist.append(A22)
Alist.append(A23)
Alist.append(A31)
Alist.append(A32)
Alist.append(A33)
bingolist =[0]*9

N = int(input())
#print (N)
for i in range(N):
  b = int(input())
  #print (b)
  for j in range(len(bingolist)):
    if b ==Alist[j]:
      bingolist[j] = 1

if sum(bingolist[0:3])==3 or sum(bingolist[3:6])==3 or sum(bingolist[6:9])==3 or (bingolist[0]+bingolist[3]+bingolist[6])==3 or (bingolist[1]+bingolist[4]+bingolist[7])==3 or (bingolist[2]+bingolist[5]+bingolist[8])==3 or (bingolist[0]+bingolist[4]+bingolist[8])==3 or (bingolist[2]+bingolist[4]+bingolist[6])==3:
  print ("Yes")
else :
  print ("No")
#print (bingolist[0:3])
#print (bingolist[3:6])
#print (bingolist[6:9])
#print (bingolist)

Verdicts: Wrong Answer

Accepted
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 = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]]).issubset(b):
	bingo = True
print(bingo)

a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(int)(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]).issubset(b):
	bingo = True
print(bingo)

a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]]).issubset(b):
	bingo = True
if bingo:
  print("Yes")
print("No")  

a = input().split()
a += input().split()
a += input().split()
n = int(input())
b = set([(input()) for i in range(n)])

bingo = False
if set([a[0], a[1], a[2]]).issubset(b):
	bingo = True
if set([a[3], a[4], a[5]]).issubset(b):
	bingo = True
if set([a[6], a[7], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[3], a[6]]).issubset(b):
	bingo = True
if set([a[1], a[4], a[7]]).issubset(b):
	bingo = True
if set([a[2], a[5], a[8]]).issubset(b):
	bingo = True
if set([a[0], a[4], a[8]]).issubset(b):
	bingo = True
if set([a[2], a[4], a[6]]).issubset(b):
	bingo = True
if bingo:
  print("Yes")
else:
  print("No")  

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
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(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]
print(A)
print(N)
print(B)
for i in range(N):
    for j in range(3):
        for k in range(3):
            if A[j][k] == B[i]:
                A[j][k] = 0
print(A)
for i in range(3):
    if (A[i][0] == A[i][1] == A[i][2] == 0):
        print("Yes")
        exit()
    if (A[0][i] == A[1][i] == A[2][i] == 0):
        print("Yes")
        exit()
if (A[0][0] == A[1][1] == A[2][2] == 0):
    print("Yes")
    exit()
elif(A[0][2] == A[1][1] == A[2][0] == 0):
    print("Yes")
    exit()
print("No")


A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]
print(A)
print(N)
print(B)
for i in range(N):
    for j in range(3):
        for k in range(3):
            if A[j][k] == B[i]:
                A[j][k] = 0
#print(A)
for i in range(3):
    if (A[i][0] == A[i][1] == A[i][2] == 0):
        print("Yes")
        exit()
    if (A[0][i] == A[1][i] == A[2][i] == 0):
        print("Yes")
        exit()
if (A[0][0] == A[1][1] == A[2][2] == 0):
    print("Yes")
    exit()
elif(A[0][2] == A[1][1] == A[2][0] == 0):
    print("Yes")
    exit()
print("No")


A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]
#print(A)
#print(N)

for i in range(N):
    for j in range(3):
        for k in range(3):
            if A[j][k] == B[i]:
                A[j][k] = 0
#print(A)
for i in range(3):
    if (A[i][0] == A[i][1] == A[i][2] == 0):
        print("Yes")
        exit()
    if (A[0][i] == A[1][i] == A[2][i] == 0):
        print("Yes")
        exit()
if (A[0][0] == A[1][1] == A[2][2] == 0):
    print("Yes")
    exit()
elif(A[0][2] == A[1][1] == A[2][0] == 0):
    print("Yes")
    exit()
print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i][j] == b(k)):
                    A[i][j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i][0]+A[i][1]+A[i][2]==0:
            ans = "Yes"
        if A[0][i]+A[1][i]+A[2][i]==0:
            ans = "Yes"
    if A[0][0]+A[1][1]+A[2][2]==0:
        ans = "Yes"
    if A[0][2]+A[1][1]+A[2][0]==0:
        ans = "Yes"
    print(ans)
main()

def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(i) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i,j] == b(k)):
                    A[i,j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i,0]+A[i,1]+A[i,2]==0: ans = "Yes"
        if A[0,i]+A[1,i]+A[2,i]==0: ans = "Yes"
    if A[0,0]+A[1,1]+A[2,2]==0: ans = "Yes"
    if A[0,2]+A[1,1]+A[2,0]==0: ans = "Yes"
    print(ans)
main()

def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(i) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if (A[i,j] == b(k)):
                    A[i,j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i,0]==A[i,1]==A[i,2]==0: ans = "Yes"
        if A[0,i]==A[1,i]==A[2,i]==0: ans = "Yes"
    if A[0,0]==A[1,1]==A[2,2]==0: ans = "Yes"
    if A[0,2]==A[1,1]==A[2,0]==0: ans = "Yes"
    print(ans)
main()

def main():
    A = [list(map(int, input().split())) for i in range(3)]
    N = int(input())
    b = [int(input()) for i in range(N)]
    
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if A[i][j] == b[k]:
                    A[i][j] = 0
    
    ans = "No"
    for i in range(3):
        if A[i][0]+A[i][1]+A[i][2]==0:
            ans = "Yes"
        if A[0][i]+A[1][i]+A[2][i]==0:
            ans = "Yes"
    if A[0][0]+A[1][1]+A[2][2]==0:
        ans = "Yes"
    if A[0][2]+A[1][1]+A[2][0]==0:
        ans = "Yes"
    print(ans)
main()

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
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=[]
for i in range(0,3):
    k=list(map(int,input().split(' ')))
    A.append(k)
n=int(input())
b=[]
for i in range(0,n+1):
    b.append(int(input()))
for i in range(0,2):
    if (A[1][i] and A[2][i] and A[0][i]) in b:
        print('Yes')
        quit()
    if (A[i][1] and A[i][2] and A[i][0]) in b:
        print('Yes')
        quit()
if (A[0][0] and A[2][2] and A[1][1]) in b:
    print('Yes')
    quit()
if (A[0][2] and A[2][0] and A[1][1]) in b:
    print('Yes')
    quit()
print('No')

A=[]
for i in range(0,3):
    k=list(map(int,input().split(' ')))
    A.append(k)
n=int(input())
b=[]
for i in range(0,n):
    b.append(int(input()))
for i in range(0,3):
    if (A[1][i] in b and A[2][i] in b and A[0][i] in b):
        print('Yes')
        quit()
    if (A[i][1] in b and A[i][2] in b and A[i][0] in b):
        print('Yes')
        quit()
if (A[0][0] in b and A[2][2] in b and A[1][1] in b):
    print('Yes')
    quit()
if (A[0][2] in b and A[2][0] in b and A[1][1] in b):
    print('Yes')
    quit()
print('No')

Verdicts: Runtime Error

Accepted
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 math
import sys

input = sys.stdin.readline


def main():
    bingo = [list(map(int, input().split())) for _ in range(3)]
    for _ in range(int(input())):
        n = int(input())
        for i in range(3):
            for j in range(3):
                if bingo[i][j] == n:
                    bingo[i][j] = True

    ret = False
    for i in range(3):
        is_break = False
        for j in range(3):
            if bingo[i][j] is not True:
                is_break = True
                break
        if not is_break:
            ret = True
            break

    if ret is True:
        print('YES')
        return

    for i in range(3):
        is_break = False
        for j in range(3):
            if bingo[j][i] is not True:
                is_break = True
                break
        if not is_break:
            ret = True
            break

    if ret is True:
        print('YES')
        return

    if bingo[0][0] is True and bingo[1][1] is True and bingo[2][2] is True:
        print('YES')
        return

    if bingo[0][2] is True and bingo[1][1] is True and bingo[2][0] is True:
        print('YES')
        return

    print('NO')


if __name__ == '__main__':
    main()


import math
import sys

input = sys.stdin.readline


def main():
    bingo = [list(map(int, input().split())) for _ in range(3)]
    for _ in range(int(input())):
        n = int(input())
        for i in range(3):
            for j in range(3):
                if bingo[i][j] == n:
                    bingo[i][j] = True

    ret = False
    for i in range(3):
        is_break = False
        for j in range(3):
            if bingo[i][j] is not True:
                is_break = True
                break
        if not is_break:
            ret = True
            break

    if ret is True:
        print('Yes')
        return

    for i in range(3):
        is_break = False
        for j in range(3):
            if bingo[j][i] is not True:
                is_break = True
                break
        if not is_break:
            ret = True
            break

    if ret is True:
        print('Yes')
        return

    if bingo[0][0] is True and bingo[1][1] is True and bingo[2][2] is True:
        print('Yes')
        return

    if bingo[0][2] is True and bingo[1][1] is True and bingo[2][0] is True:
        print('Yes')
        return

    print('No')


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
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 numpy as np
def main():
    a_list = np.array([list(map(int, input().split())) for _ in range(3)])
    n = int(input())
    b_list = [int(input()) for _ in range(n)]
    for b in b_list:
        tmp = np.argwhere(a_list == b).tolist()
        if tmp:
            a_list[tmp[0][0], tmp[0][1]] = 0
    print(a_list)
    for i in range(3):
        
        if all([a == 0 for a in a_list[i]]):
            print("Yes")
            return
    
    for i in range(3):
        if all([a_list[j][i] == 0 for j in range(3)]):
            print("Yes")
            return
    
    if a_list[0][0] == a_list[1][1] == a_list[2][2] == 0:
        print("Yes")
        return
    if a_list[0][2] == a_list[1][1] == a_list[2][0] == 0:
        print("Yes")
        return
    print("No")
main()






import numpy as np
def main():
    a_list = np.array([list(map(int, input().split())) for _ in range(3)])
    n = int(input())
    b_list = [int(input()) for _ in range(n)]
    for b in b_list:
        tmp = np.argwhere(a_list == b).tolist()
        if tmp:
            a_list[tmp[0][0], tmp[0][1]] = 0
    for i in range(3):
        
        if all([a == 0 for a in a_list[i]]):
            print("Yes")
            return
    
    for i in range(3):
        if all([a_list[j][i] == 0 for j in range(3)]):
            print("Yes")
            return
    
    if a_list[0][0] == a_list[1][1] == a_list[2][2] == 0:
        print("Yes")
        return
    if a_list[0][2] == a_list[1][1] == a_list[2][0] == 0:
        print("Yes")
        return
    print("No")
main()


Verdicts: Wrong Answer

Accepted