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

N = int(input())
b = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

if (sum(A[0]) or sum(A[1]) or sum(A[2])
   or sum(A[:][0]) or sum(A[:][1]) or sum(A[:][2])
   or (A[0][0]+A[1][1]+A[2][2]) or (A[0][2]+A[1][1]+A[2][0])) == 0:
  print("Yes")
else:
  print("No")

A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)
print(A)

N = int(input())
b = [int(input()) for i in range(N)]
print(b)

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

if A[1][1] == 0:
  if A[0][0]==A[2][2]==0 or A[0][2]==A[2][0]==0:
    print("Yes")
  else:
    print("No")
elif A[1][1] != 0:
  if sum(A[0])==0 or sum(A[2])==0 or sum(A[:][0])==0 or sum(A[:][2]==0):
    print("Yes")
  else:
    print("No")

A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)

N = int(input())
b = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

if (sum(A[0][:]) or sum(A[1][:]) or sum(A[2][:])
   or sum(A[:][0]) or sum(A[:][1]) or sum(A[:][2])
   or (A[0][0]+A[1][1]+A[2][2]) or (A[0][2]+A[1][1]+A[2][0])) == 0:
  print("Yes")
else:
  print("No")

A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)

N = int(input())
b = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

def Agetraw(j):
    Ans = [int(A[i][j]) for i in range(3)]
    return(Ans)

if (sum(A[0]) or sum(A[1]) or sum(A[2]) 
    or sum(Agetraw(0)) or sum(Agetraw(1)) or sum(Agetraw(2)) 
    or A[0][0]+A[1][1]+A[2][2] or A[0][2]+A[1][1]+A[2][0]) == 0:
  print("Yes")
else:
  print("No")


A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)

N = int(input())
b = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

def Agetraw(j):
    Ans = [int(A[i][j]) for i in range(3)]
    return(Ans)

if (sum(A[0])==0 or sum(A[1])==0 or sum(A[2])==0 
    or sum(Agetraw(0))==0 or sum(Agetraw(1))==0 or sum(Agetraw(2))==0 
    or 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: Wrong Answer

Runtime Error

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):
a11,a12,a13=map(int,input().split())
a21,a22,a23=map(int,input().split())
a31,a32,a33=map(int,input().split())

n=int(input())

card=[a11,a12,a13,a21,a22,a23,a31,a32,a33]
def isBingo():
   if ( (card[0] == -1 and card[1] == -1 and card[2] == -1) \
      or (card[3] == -1 and card[4] == -1 and card[5] == -1) \
      or (card[6] == -1 and card[7] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[3] == -1 and card[6] == -1) \
      or (card[1] == -1 and card[4] == -1 and card[7] == -1) \
      or (card[2] == -1 and card[5] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[4] == -1 and card[8] == -1) \
      or (card[2] == -1 and card[4] == -1 and card[6] == -1) \
      ):
      return True
   else:
      return False
    
for i in range(n):
  if i in card:
    card[card.index(i)]=-1
if( isBingo()):
    print("Yes")
else:
    print("No")
    
       
       
       
       
       

a11,a12,a13=map(int,input().split())
a21,a22,a23=map(int,input().split())
a31,a32,a33=map(int,input().split())

n=int(input())

card=[a11,a12,a13,a21,a22,a23,a31,a32,a33]
def isBingo():
   if ( (card[0] == -1 and card[1] == -1 and card[2] == -1) \
      or (card[3] == -1 and card[4] == -1 and card[5] == -1) \
      or (card[6] == -1 and card[7] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[3] == -1 and card[6] == -1) \
      or (card[1] == -1 and card[4] == -1 and card[7] == -1) \
      or (card[2] == -1 and card[5] == -1 and card[8] == -1) \
      or (card[0] == -1 and card[4] == -1 and card[8] == -1) \
      or (card[2] == -1 and card[4] == -1 and card[6] == -1) \
      ):
      return True
   else:
      return False
    
for i in range(n):
  i= int(input())
  if i in card:
    card[card.index(i)]=-1
if( isBingo()):
    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):
# coding: utf-8
import numpy as np

card = np.array([list(map(int, input().split())) for _ in range(3)])
n = int(input())

for _ in range(n):
    num = int(input())
    if num in card:
        pos = tuple(nd[0] for nd in np.where(card == num))
        print(pos)
        card[pos[0], pos[1]] = 0

f = 0

for i in range(3):
    if sum(card[i,:]) == 0 or sum(card[:,i]) == 0:
        f = 1
    if card[0,0]+card[1,1]+card[2,2] == 0 or card[2,0]+card[1,1]+card[2,0] == 0:
        f = 1

if f:
    print('Yes')
else:
    print('No')

# coding: utf-8
import numpy as np

card = np.array([list(map(int, input().split())) for _ in range(3)])
n = int(input())

for _ in range(n):
    num = int(input())
    if num in card:
        pos = tuple(nd[0] for nd in np.where(card == num))
        card[pos[0], pos[1]] = 0

f = 0

for i in range(3):
    if sum(card[i,:]) == 0 or sum(card[:,i]) == 0:
        f = 1
    if card[0,0]+card[1,1]+card[2,2] == 0 or card[2,0]+card[1,1]+card[2,0] == 0:
        f = 1

if f:
    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):
Bingo = [ list(map(int,input().split())) for i in range(3)]
n = int(input())
num = [int(input()) for i in range(n)]
Bingo.append([Bingo[0][0] , Bingo[1][1],Bingo[2][2] ])
Bingo.append([Bingo[0][2] , Bingo[1][1],Bingo[2][0] ])
k=0
re = 'No'
for l in range(3):
  if len(list(set(num) & set(Bingo[l]))) == 3:
    re = 'Yes'
    break
print(re)

Bingo = [ list(map(int,input().split())) for i in range(3)]
n = int(input())
num = [int(input()) for i in range(n)]
Bingo.append([Bingo[0][0] , Bingo[1][1],Bingo[2][2] ])
Bingo.append([Bingo[0][2] , Bingo[1][1],Bingo[2][0] ])
for k in range(3):
  Bingo.append([Bingo[0][k] , Bingo[1][k],Bingo[2][k] ])
k=0
re = 'No'
for l in range(len(Bingo)):
  if len(list(set(num) & set(Bingo[l]))) == 3:
    re = 'Yes'
    break
print(re)

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):
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 22:38:51 2020

@author: Kanaru Sato
"""

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

N = int(input())

b = []
[b.append(list(map(int, input()))) for i in range(0,N)]

flag = [[0, 0, 0]
        [0, 0, 0]
        [0, 0, 0]]

for i in range(0,3):
    for j in range(0,3):
        if A[i][j] in b:
            flag[i][j] = 1

column = 0
raw = 0
naname = 0

for i in range(0,3):
    column += flag[i][0]*flag[i][1]*flag[i][2]
    raw += flag[0][i]*flag[1][i]*flag[2][i]
naname = flag[0][0]*flag[1][1]*flag[2][2]+flag[0][2]*flag[1][1]*flag[2][0]

if column>=1 or raw>=1 or naname>=1:
    print("Yes")
else:
    print("No")

# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 22:38:51 2020

@author: Kanaru Sato
"""

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

N = int(input())

b = []
[b.append(int(input())) for i in range(0,N)]

flag = [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]]

for i in range(0,3):
    for j in range(0,3):
        if A[i][j] in b:
            flag[i][j] = 1

column = 0
raw = 0
naname = 0

for i in range(0,3):
    column += flag[i][0]*flag[i][1]*flag[i][2]
    raw += flag[0][i]*flag[1][i]*flag[2][i]
naname = flag[0][0]*flag[1][1]*flag[2][2]+flag[0][2]*flag[1][1]*flag[2][0]

print(flag)

if column>=1 or raw>=1 or naname>=1:
    print("Yes")
else:
    print("No")

# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 22:38:51 2020

@author: Kanaru Sato
"""

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

N = int(input())

b = []
[b.append(int(input())) for i in range(0,N)]

flag = [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 0]]

for i in range(0,3):
    for j in range(0,3):
        if A[i][j] in b:
            flag[i][j] = 1

column = 0
raw = 0
naname = 0

for i in range(0,3):
    column += flag[i][0]*flag[i][1]*flag[i][2]
    raw += flag[0][i]*flag[1][i]*flag[2][i]
naname = flag[0][0]*flag[1][1]*flag[2][2]+flag[0][2]*flag[1][1]*flag[2][0]


if column>=1 or raw>=1 or naname>=1:
    print("Yes")
else:
    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):
a= []
for i in range(3):
  a_input = input().split()
  a.append(int(a_input))

for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == int(a[j][k]):
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
    else:
      print("No")

a= []
for i in range(3):
  a_input = input().split()
  a.append(int(a_input))

for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == a[j][k]:
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
    else:
      print("No")

a= []
for i in range(3):
  a_input = input().split()
  a.append(a_input)

n = int(input())
for i in range(n):
  x = input()
  for j in range(3):
    for k in range(3):
      if x == a[j][k]:
        a[j][k] = "0"

for i in range(3):
    if a[0][i] == "0" and a[0][i] == a[1][i] and a[0][i] == a[2][i]:
      print("Yes")
      exit()
    elif a[i][0] == "0" and a[i][0] == a[i][1] and a[i][0] == a[i][2]:
      print("Yes")
      exit()
    elif a[0][0] == "0" and a[0][0] == a[1][1] and a[1][1] == a[2][2]:
      print("Yes")
      exit()
    elif a[0][2] == "0" and a[0][2] == a[1][1] and a[0][2] == a[2][0]:
      print("Yes")
      exit()
print("No")
      

Verdicts: 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):
def row_sums(B):
    return sum(B[0])==0 or sum(B[1])==0 or sum(B[2]) == 0

def diagonal_sum(M):
    i,j = -1,-1
    sums = 0
    for _ in range(3):
        i += 1
        j += 1
        sums += M[i][j]
    return  sums == 0

def column_sum(M):
    columns = list(zip(*M))
    return row_sums(columns)

has = [[int(x) for x in input().split()] for _ in range(3)]
calls = int(input())
for _ in range(calls):
    current = int(input())
    for i in range(3):
        if current in has[i]:
            has[i][has[i].index(current)]=0

'''
if row_sums(has) or column_sum(has) or diagonal_sum(has):
    print('Yes')
else:print('No')
'''
answer = "NO"
for i in range(3):
    if has[i][0]==has[i][1]==has[i][2]==0:ans="Yes"
    if has[0][i]==has[1][i]==has[2][i]==0:ans="Yes"
if has[0][0]==has[1][1]==has[2][2]==0:ans="Yes"
if has[2][0]==has[1][1]==has[0][2]==0:ans="Yes"
print(answer)





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

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):
up = list(input().split())
mid = list(input().split())
down = list(input().split())

table = [up, mid, down]
# print(table)
nums = []
while True:
    try:
        nums.append(input())
    except EOFError:
        break
# print(nums)

for i in range(3):
  for j in range(3):
    if table[i][j] in nums:
      table[i][j] = 'T'

flag = False

for i in range(3):
  if table[i].count('T') == 3:
    print('YES')
    flag = True


if flag == False:
  if table[0][0]=='T' and table[0][1]=='T' and table[0][2]=='T':
    print('YES')
    flag = True
    
if flag == False:
  if table[1][0]=='T' and table[1][1]=='T' and table[1][2]=='T':
    print('YES')
    flag = True
    
if flag == False:
  if table[2][0]=='T' and table[2][1]=='T' and table[2][2]=='T':
    print('YES')
    flag = True


if flag == False:
  if table[0][0]=='T' and table[1][1]=='T' and table[2][2]=='T':
    print('YES')
    flag = True
    
if flag == False:
  if table[0][2]=='T' and table[1][1]=='T' and table[2][0]=='T':
    print('YES')
    flag = True
    
if flag == False:
  print('NO')

up = list(input().split())
mid = list(input().split())
down = list(input().split())

table = [up, mid, down]

nums = []
while True:
    try:
        nums.append(input())
    except EOFError:
        break

for i in range(3):
  for j in range(3):
    if table[i][j] in nums:
      table[i][j] = 'T'

flag = False

for i in range(3):
  if table[i].count('T') == 3:
    print('Yes')
    flag = True
    if flag == True:
      break

if flag == False:
  if table[0][0]=='T' and table[1][0]=='T' and table[2][0]=='T':
    print('Yes')
    flag = True
    
if flag == False:
  if table[0][1]=='T' and table[1][1]=='T' and table[2][1]=='T':
    print('Yes')
    flag = True
    
if flag == False:
  if table[0][2]=='T' and table[1][2]=='T' and table[2][2]=='T':
    print('Yes')
    flag = True

if flag == False:
  if table[0][0]=='T' and table[1][1]=='T' and table[2][2]=='T':
    print('Yes')
    flag = True
    
if flag == False:
  if table[0][2]=='T' and table[1][1]=='T' and table[2][0]=='T':
    print('Yes')
    flag = True
    
if flag == False:
  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):
A = []
B = []
cnt = 0

for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())

for i in range(N):
    B.append(int(input()))

for i in range(3):
    for j in range(3):
        for k in B:
            if A[i][j] == k:
                A[i][j] = 0

for i in range(3):            
    if A[i][0]==0 and A[i][0]==A[i][1] and A[i][1]==A[i][2]:
        print('Yes')
    
    elif A[0][i]==0 and A[0][i]==A[1][i] and A[1][i]==A[2][i]:
        print('Yes')
    
    elif A[0][0]==0 and A[0][0]==A[1][1] and A[1][1]==A[2][2]:
        print('Yes')
    elif A[0][2]==0 and A[0][2]==A[1][1] and A[1][1]==A[2][0]:
        print('Yes')
    else:
        print('No')

A = []
B = []
cnt = 0

for i in range(3):
    A.append(list(map(int, input().split())))

N = int(input())

for i in range(N):
    B.append(int(input()))

for i in range(3):
    for j in range(3):
        for k in B:
            if A[i][j] == k:
                A[i][j] = 0
import sys
for i in range(3):            
    if A[i][0]==0 and A[i][0]==A[i][1] and A[i][1]==A[i][2]:
        print('Yes')
        sys.exit()
    elif A[0][i]==0 and A[0][i]==A[1][i] and A[1][i]==A[2][i]:
        print('Yes')
        sys.exit()
    elif A[0][0]==0 and A[0][0]==A[1][1] and A[1][1]==A[2][2]:
        print('Yes')
        sys.exit()
    elif A[0][2]==0 and A[0][2]==A[1][1] and A[1][1]==A[2][0]:
        print('Yes')
        sys.exit()

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):
def check(a,b):
    if a==b:
        a=-1

A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
N=int(input())

i = 0
j = 0
while i<N:
    b = int(input())
    while j<3:
        check(A1[j],b)
    while j<3:
        check(A2[j],b)
    while j<3:
        check(A3[j],b)

if A1[0]==A1[1]==A1[2] or A2[0]==A2[1]==A2[2] or A3[0]==A3[1]==A3[2] or A1[0]==A2[0]==A3[0] or A1[1]==A2[1]==A3[1] or A1[2]==A2[2]==A3[2] or A1[0]==A2[1]==A3[2] or A1[2]==A2[1]==A3[0]:
    print("Yes")
else:
    print("No")

def check(a,b):
    if a==b:
        a=-1

A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
N=int(input())

i = 0
j = 0
while i<N:
    b = int(input())
    while j<3:
        check(A1[j],b)
        j+=1
    while j<3:
        check(A2[j],b)
        j+=1
    while j<3:
        check(A3[j],b)
        j+=1
    i+=1

if A1[0]==A1[1]==A1[2] or A2[0]==A2[1]==A2[2] or A3[0]==A3[1]==A3[2] or A1[0]==A2[0]==A3[0] or A1[1]==A2[1]==A3[1] or A1[2]==A2[2]==A3[2] or A1[0]==A2[1]==A3[2] or A1[2]==A2[1]==A3[0]:
    print("Yes")
else:
    print("No")

def check(a,b):
    if a==b:
        a=-1

A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
N=int(input())
B=list(map(int,input().split()))

i = 0
j = 0
while i<N:
    while j<3:
        check(A1[j],B[i])
while i<N:
    while j<3:
        check(A2[j],B[i])
while i<N:
    while j<3:
        check(A3[j],B[i])

if A1[0]==A1[1]==A1[2] or A2[0]==A2[1]==A2[2] or A3[0]==A3[1]==A3[2] or A1[0]==A2[0]==A3[0] or A1[1]==A2[1]==A3[1] or A1[2]==A2[2]==A3[2] or A1[0]==A2[1]==A3[2] or A1[2]==A2[1]==A3[0]:
    print("Yes")
else:
    print("No")

f = lambda:list(map(int,input().split()))
l = f() + f() + f()
n = int(input())
s = set()

for i in range(n):
    b = int(input())
    if b in l: s|={l.index(b)}

print(['No','Yes'][any(t<=s for t in [{0,1,2},{0,3,6},{0,4,8},{1,4,7},
                                      {2,4,6},{2,5,8},{3,4,5},{6,7,8}])])

Verdicts: Time Limit Exceeded

Wrong Answer

Time Limit Exceeded

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

N = int(input())

B = [int(input()) for i in range(N)]

C = [[0,0,0],[0,0,0],[0,0,0]]
Ans = "No"

for i in range(3):
    for j in range(3):
        if A[i][j] in B:         
            C[i][j] = 1

for i in range(3):
    if C[i][1]+C[i][2]+C[i][3] == 3:
        Ans ="Yes"

for i in range(3):
    if C[1][i]+C[2][i]+C[3][i] == 3:
        Ans ="Yes"
        
if C[1][1]+C[2][2]+C[3][2] == 3 or C[1][3]+C[2][2]+C[3][1] == 3:
    Ans = "Yes"
    
print(Ans)
            
        

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

N = int(input())

B = [int(input()) for i in range(N)]

C = [[0,0,0],[0,0,0],[0,0,0]]
Ans = "No"

for i in range(3):
    for j in range(3):
        if A[i][j] in B:         
            C[i][j] = 1

for i in range(3):
    if C[i][0]+C[i][1]+C[i][2] == 3:
        Ans ="Yes"

for i in range(3):
    if C[0][i]+C[1][i]+C[2][i] == 3:
        Ans ="Yes"
        
if C[0][0]+C[1][1]+C[2][2] == 3 or C[0][2]+C[1][1]+C[2][0] == 3:
    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):
A = []
for i in range(3):
    a = list(map(int, input().split()))
    A.append(a)

N = int(input())

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

for b in B:
    for i in range(3):
        for j in range(3):
            if b == A[i][j]:
                A[i][j] = 0

ans = "NO"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2] == 0:
        ans = "YES"
        break
    if A[0][i] == A[1][i] == A[2][i] == 0:
        ans = "YES"
        break
    if A[0][0] == A[1][1] == A[2][2] == 0:
        ans = "YES"
        break
    if A[0][2] == A[1][1] == A[2][0] == 0:
        ans = "YES"
print(ans)

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

N = int(input())

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

for b in B:
    for i in range(3):
        for j in range(3):
            if b == A[i][j]:
                A[i][j] = 0

ans = "NO"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2] == 0:
        ans = "YES"
        break
    if A[0][i] == A[1][i] == A[2][i] == 0:
        ans = "YES"
        break
    if A[0][0] == A[1][1] == A[2][2] == 0:
        ans = "YES"
        break
    if A[0][2] == A[1][1] == A[2][0] == 0:
        ans = "YES"
print(ans)

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

N = int(input())

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

for b in B:
    print(b)
    for i in range(3):
        for j in range(3):
            if b == A[i][j]:
                A[i][j] = 0

ans = "NO"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2] == 0:
        ans = "YES"
        break
    if A[0][i] == A[1][i] == A[2][i] == 0:
        ans = "YES"
        break
    if A[0][0] == A[1][1] == A[2][2] == 0:
        ans = "YES"
        break
    if A[0][2] == A[1][1] == A[2][0] == 0:
        ans = "YES"
print(ans)

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

N = int(input())

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

for b in B:
    for i in range(3):
        for j in range(3):
            if b == A[i][j]:
                A[i][j] = 0

ans = "No"
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2] == 0:
        ans = "Yes"
        break
    if A[0][i] == A[1][i] == A[2][i] == 0:
        ans = "Yes"
        break
    if A[0][0] == A[1][1] == A[2][2] == 0:
        ans = "Yes"
        break
    if A[0][2] == A[1][1] == A[2][0] == 0:
        ans = "Yes"
print(ans)

Verdicts: Wrong Answer

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):
Card=[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(N):
    for j in range(3):
        for k in range(3):
            if A[j][k]==b[i]:
                A[j][k]=0
if (A[0][0]==A[0][1]==A[0][2]==0) or (A[1][0]==A[1][1]==A[1][2]==0) or (A[2][0]==A[2][1]==A[2][2]==0) or (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) or (A[0][0] == A[1][1] == A[2][2] == 0) or (A[2][0]==A[1][1]==A[0][2]==0):
    print('Yes')
else:
    print('No')

card=[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(N):
    for j in range(3):
        for k in range(3):
            if card[j][k]==b[i]:
                card[j][k]=0
if (card[0][0]==card[0][1]==card[0][2]==0) or (card[1][0]==card[1][1]==card[1][2]==0) or (card[2][0]==card[2][1]==card[2][2]==0) or (card[0][0]==card[1][0]==card[2][0]==0) or (card[0][1]==card[1][1]==card[2][1]==0)  or (card[0][2]==card[1][2]==card[2][2]==0) or (card[0][0] == card[1][1] == card[2][2] == 0) or (card[2][0]==card[1][1]==card[0][2]==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):
d=[list(map(int,input().split()))for i in range(3)]
row=int(input())
num=[int(input()) for j in range(row)]
bingo=0
for a in range(3):
  if d[0][a] and d[1][a] and d[2][a] in num:
    bingo=bingo+1
  elif d[a][0] and d[a][1] and d[a][1] in num:
    bingo=bingo+1
if d[1][1] and d[2][2] and d[3][3] in num:
  bingo=bingo+1
elif d[3][1] and d[2][2] and d[1][3] in num:
  bingo=bingo+1
if bingo>0:
  print('Yes')
else:
  print('No')

d=[list(map(int,input().split()))for i in range(3)]
row=int(input())
num=[int(input()) for j in range(row)]
bingo=0
for a in range(3):
  if d[0][a] in num and d[1][a] in num and d[2][a] in num:
    bingo=bingo+1
  if d[a][0] in num and d[a][1] in num and d[a][2] in num:
    bingo=bingo+1
if d[1][1] in num and d[2][2] in num and d[0][0] in num:
  bingo=bingo+1
if d[1][1] in num and d[0][2] in num and d[2][0] in num:
  bingo=bingo+1
if bingo>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):
A=[[int(i) for i in input().split()] for _ in range(3)]
N=int(input())
for _ in range(N):
    b=int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j]==b:
                A[i][j]=-1
flag=False
for h in range(3):
    cnt=0
    for w in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
for w in range(3):
    cnt=0
    for h in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
cnt=0
if A[d][d]==-1:
    cnt+=1
if cnt==3:
    flag=True
cnt=0
if A[d][-d]==-1:
    cnt+=1
if cnt==3:
    flag=True
print('Yes' if flag else 'No')


A=[[int(i) for i in input().split()] for _ in range(3)]
N=int(input())
for _ in range(N):
    b=int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j]==b:
                A[i][j]=-1
flag=False
for h in range(3):
    cnt=0
    for w in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
for w in range(3):
    cnt=0
    for h in range(3):
        if A[h][w]==-1:
            cnt+=1
    if cnt==3:
        flag=True
cnt=0
for d in range(3):
    if A[d][d]==-1:
        cnt+=1
if cnt==3:
    flag=True
cnt=0
for d in range(3):
    if A[d][2-d]==-1:
        cnt+=1
if cnt==3:
    flag=True
print('Yes' if flag else '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 = [input().split() for l in range(3)]
n = int(input())
b = [input() for i in range(n)]
c = [a[0][0],a[1][1],a[2][2]]
d = [a[0][2],a[1][1],a[2][0]]
tate1 = len(set(a[0]) & set(b))
tate2 = len(set(a[1]) & set(b))
tate3 = len(set(a[2]) & set(b))
yoko1 = len(set([x[0] for x in a]) & set(b))
yoko2 = len(set([x[1] for x in a]) & set(b))
yoko3 = len(set([x[2] for x in a]) & set(b))
naname1 = len(set(c) & set(b))
naname2 = len(set(d) & set(b))
bingo = [tate1,tate2,tate3,yoko1,yoko2,yoko3,naname1,naname2]
if 3 in bingo:
  print("bingo")
else:
  print("NG")

a = [input().split() for l in range(3)]
print(a)
n = int(input())
print(n)
b = [input() for i in range(n)]
print(b)
c = [a[0][0],a[1][1],a[2][2]]
d = [a[0][2],a[1][1],a[2][0]]
tate1 = len(set(a[0]) & set(b))
tate2 = len(set(a[1]) & set(b))
tate3 = len(set(a[2]) & set(b))
yoko1 = len(set([x[0] for x in a]) & set(b))
yoko2 = len(set([x[1] for x in a]) & set(b))
yoko3 = len(set([x[2] for x in a]) & set(b))
naname1 = len(set(c) & set(b))
naname2 = len(set(d) & set(b))
bingo = [tate1,tate2,tate3,yoko1,yoko2,yoko3,naname1,naname2]
if 3 in bingo:
  print("Yes")
else:
  print("No")

a = [input().split() for l in range(3)]
n = int(input())
b = [input() for i in range(n)]
c = [a[0][0],a[1][1],a[2][2]]
d = [a[0][2],a[1][1],a[2][0]]
tate1 = len(set(a[0]) & set(b))
tate2 = len(set(a[1]) & set(b))
tate3 = len(set(a[2]) & set(b))
yoko1 = len(set([x[0] for x in a]) & set(b))
yoko2 = len(set([x[1] for x in a]) & set(b))
yoko3 = len(set([x[2] for x in a]) & set(b))
naname1 = len(set(c) & set(b))
naname2 = len(set(d) & set(b))
bingo = [tate1,tate2,tate3,yoko1,yoko2,yoko3,naname1,naname2]
if 3 in bingo:
  print("Yes")
else:
  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):
import numpy as np


a = []

for i in range(3):
    a.append(list(map(int, input().split())))


a = np.array(a)

#print(a)

n = int(input())

for i in range(n):
    b = int(input())
    for j in a:
        for k in j:
            if (k == b):
                k = 0
                break

ans = min(sum(a[0]), sum(a[1]), sum(a[2]))
ans = min(ans, (a[0][0] + a[1][1] + a[2][2]), a[0][2] + a[1][1] + a[2][0])
a.T
ans = min(ans,sum(a[0]), sum(a[1]), sum(a[2]))

print(["No","Yes"][ans == 0])

a = []

for i in range(3):
    a.append(list(map(int, input().split())))

n = int(input())

for i in range(n):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if (a[j][k] == b):
                a[j][k] = 0
                break

#print(a)

ans = min(sum(a[0]), sum(a[1]), sum(a[2]),(a[0][0] + a[1][1] + a[2][2]), (a[0][2] + a[1][1] + a[2][0]),(a[0][0] + a[1][0] + a[2][0]),(a[0][1] + a[1][1] + a[2][1]),(a[0][2] + a[1][2] + a[2][2]))

print(["No","Yes"][ans == 0])

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)]
N = int(input())

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i]
if val == 0:
    flag True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

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

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i]
if val == 0:
    flag = True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

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

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

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

val = 0
flag = False

for i in range(N):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if A[j][k] == b:
                A[j][k] = 0

val = 0
for i in range(3):
    val += A[i][i]
if val == 0:
    flag = True

val = A[0][2] + A[1][1] + A[2][0]
if val == 0:
    flag = True

for i in range(3):
    if sum(A[i]) == 0:
        flag = True
    
    val = 0
    for j in range(3):
        val += A[j][i]
    if val == 0:
        flag = True

if flag == True:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

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_ROW_NO = 3

A  = []
for i in range(BINGO_ROW_NO):
    A.append(input().split())
print(A)

N = int(input())



def SetBingo(A, b):
    for y in range(BINGO_ROW_NO - 1):
        for x in range(BINGO_ROW_NO - 1):
            if A[y][x] == b:
                A[y][x] = ''
                return 
    return 

for _ in range(N):
    b = input()
    SetBingo(A, b)

isBingo = False


for i in range(BINGO_ROW_NO):
    if A[i][0] == '' and A[i][1] == '' and A[i][2] == '':
        isBingo = True

for i in range(BINGO_ROW_NO):
    if A[0][i] == '' and A[1][i] == '' and A[2][i] == '':
        isBingo = True

for i in range(BINGO_ROW_NO):
    if A[i][i] != '':
        break
    isBingo = True

for i in range(BINGO_ROW_NO):
    if A[i][BINGO_ROW_NO - 1 - i] != '':
        break
    isBingo = True

if isBingo:
    print('Yes')
else:
    print('No')


BINGO_ROW_NO = 3

A  = []
for i in range(BINGO_ROW_NO):
    A.append(input().split())

N = int(input())



def SetBingo(A, b):
    for y in range(BINGO_ROW_NO):
        for x in range(BINGO_ROW_NO):
            if A[y][x] == b:
                A[y][x] = ''
                return 
    return 

for _ in range(N):
    b = input()
    SetBingo(A, b)

isBingo = False


for i in range(BINGO_ROW_NO):
    if A[i][0] == '' and A[i][1] == '' and A[i][2] == '':
        isBingo = True

for i in range(BINGO_ROW_NO):
    if A[0][i] == '' and A[1][i] == '' and A[2][i] == '':
        isBingo = True

if A[0][0] == '' and A[1][1] == '' and A[2][2] == '':
    isBingo = True

if A[0][2] == '' and A[1][1] == '' and A[2][0] == '':
    isBingo = True

if isBingo:
    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):
list1 = []
for x in range(3):
    list1.append([int(i)for i in input().split()])
n = int(input())
indices = []
for x in range(n):
    val = int(input())
    if val in list1[0]:
        indices.append([list1[0].index(val),0])
    elif val in list1[1]:
        indices.append([list1[1].index(val),1])
    elif val in list1[2]:
        indices.append([list1[2].index(val),2])
    else:
        indices.append(-1)
if [0,0] in indices and [0,1] in indices and [0,2] in indices:
    print("YES")
elif [1,0] in indices and [1,1] in indices and [1,2] in indices:
    print("YES")
elif [2,0] in indices and [2,1] in indices and [2,2] in indices:
    print("YES")
elif [0,0] in indices and [1,0] in indices and [2,0] in indices:
    print("YES")
elif [0,1] in indices and [1,1] in indices and [2,1] in indices:
    print("YES")
elif [0,2] in indices and [1,2] in indices and [2,2] in indices:
    print("YES")
elif [0,0] in indices and [1,1] in indices and [2,2] in indices:
    print("YES")
else:
    print("NO")

list1 = []
for x in range(3):
    list1.append([int(i)for i in input().split()])
n = int(input())
indices = []
for x in range(n):
    val = int(input())
    if val in list1[0]:
        indices.append([list1[0].index(val),0])
    elif val in list1[1]:
        indices.append([list1[1].index(val),1])
    elif val in list1[2]:
        indices.append([list1[2].index(val),2])
    else:
        indices.append(-1)
if [0,0] in indices and [0,1] in indices and [0,2] in indices:
    print("Yes")
elif [1,0] in indices and [1,1] in indices and [1,2] in indices:
    print("Yes")
elif [2,0] in indices and [2,1] in indices and [2,2] in indices:
    print("Yes")
elif [0,0] in indices and [1,0] in indices and [2,0] in indices:
    print("Yes")
elif [0,1] in indices and [1,1] in indices and [2,1] in indices:
    print("Yes")
elif [0,2] in indices and [1,2] in indices and [2,2] in indices:
    print("Yes")
elif [0,0] in indices and [1,1] in indices and [2,2] in indices:
    print("Yes")
elif [0,2] in indices and [1,1] in indices and [2,0] in indices:
    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):
a=[list(map(int,input().split())) for _ in range(3)]
n=int(input())
b=[int(input()) for _ in range(n)]
maze=[["*" for i in range(3)] for _ in range(3)]
for i in range(3):
    for j in range(3):
        for k in range(n):
            if b[i]==a[j][k]:
                maze[j][k]="#"
for i in range(3):
    f=1
    for j in range(3):
        if maze[i][j]!="#":
            f=0
            break
    if f:
        print("Yes")
        exit()
for i in range(3):
    fc=1
    for j in range(3):
        if maze[j][i]!="#":
            fc=0
            break
    if fc:
        print("Yes")
        exit()
for i in range(3):
    fa=1
    if maze[i][i]!="#":
        fa=0
        break
if fa:
    print("Yes")
    exit()
for i in range(3):
    fe=1
    if maze[i][2-i]!="#":
        fe=0
        break
if fe:
    print("Yes")
    exit()
print("No")

a=[list(map(int,input().split())) for _ in range(3)]
n=int(input())
b=[int(input()) for _ in range(n)]
maze=[["*" for i in range(3)] for _ in range(3)]
for i in range(n):
    for j in range(3):
        for k in range(3):
            if b[i]==a[j][k]:
                maze[j][k]="#"
for i in range(3):
    f=1
    for j in range(3):
        if maze[i][j]!="#":
            f=0
            break
    if f:
        print("Yes")
        exit()
for i in range(3):
    fc=1
    for j in range(3):
        if maze[j][i]!="#":
            fc=0
            break
    if fc:
        print("Yes")
        exit()
for i in range(3):
    fa=1
    if maze[i][i]!="#":
        fa=0
        break
if fa:
    print("Yes")
    exit()
for i in range(3):
    fe=1
    if maze[i][2-i]!="#":
        fe=0
        break
if fe:
    print("Yes")
    exit()
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, b, c = input().split()
d, e, f = input().split()
g, h, i = input().split()
N = int(input())

num_list = []
for _ in range(N):
    num_list.append(int(input()))

for j in num_list:
    if a == j:
        a = 101
    if b == j:
        b = 101
    if c == j:
        c = 101
    if d == j:
        d = 101
    if e == j:
        e = 101
    if f == j:
        f = 101
    if g == j:
        g = 101
    if h == j:
        h = 101
    if i == j:
        i = 101

answer = 'No'
if a + b + c == 303:
    answer = 'Yes'
if d + e + f == 303:
    answer = 'Yes'
if g + h + i == 303:
    answer = 'Yes'
if a + d + g == 303:
    answer = 'Yes'
if b + e + h == 303:
    answer = 'Yes'
if c + f + i == 303:
    answer = 'Yes'
if a + e + i == 303:
    answer = 'Yes'
if c + e + g == 303:
    answer = 'Yes'

print(answer)

a, b, c = map(int, input().split())
d, e, f = map(int, input().split())
g, h, i = map(int, input().split())
N = int(input())

num_list = []
for _ in range(N):
    num_list.append(int(input()))

for j in num_list:
    if a == j:
        a = 101
    if b == j:
        b = 101
    if c == j:
        c = 101
    if d == j:
        d = 101
    if e == j:
        e = 101
    if f == j:
        f = 101
    if g == j:
        g = 101
    if h == j:
        h = 101
    if i == j:
        i = 101

answer = 'No'
if a + b + c == 303:
    answer = 'Yes'
if d + e + f == 303:
    answer = 'Yes'
if g + h + i == 303:
    answer = 'Yes'
if a + d + g == 303:
    answer = 'Yes'
if b + e + h == 303:
    answer = 'Yes'
if c + f + i == 303:
    answer = 'Yes'
if a + e + i == 303:
    answer = 'Yes'
if c + e + g == 303:
    answer = 'Yes'

print(answer)

Verdicts: Wrong Answer

Accepted