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

for number in b: 
    for i in range(3):
        if number in a[i]: 
            a[i][a[i].index(number)] = 0 

if a[0][0] == a[1][1] == a[2][2] == 0 or a[2][0] == a[1][1] == a[0][2] == 0:
    print('Yes')　
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2] == 0:
            print('Yes') 
            break
        elif a[0][i] == a[1][i] == a[2][i] == 0:
            print('Yes') 
            break
        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 number in b:
    for i in range(3):
        if number in a[i]:
            a[i][a[i].index(number)] = 0
if a[0][0] == a[1][1] == a[2][2] == 0 or a[2][0] == a[1][1] == a[0][2] == 0:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2] == 0:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i] == 0:
            print('Yes')
            break
    	else:
        	print('No')


bingo = [list(map(int, input().split())) for _  in range(3)]
N = int(input())
out = [int(input()) for _ in range(N)]

for i in out: 
    for j in range(3):
        if i in bingo[j]: 
            bingo[j][bingo[j].index(i)] = 0

if bingo[0][0] == bingo[1][1] == bingo[2][2] == 0 or bingo[0][2] == bingo[1][1] == bingo[2][0] == 0:
    print("Yes")

else :
    for i in range(3):
        if bingo[i][0] == bingo[i][1] == bingo[i][2] == 0:
            print("Yes")
            break
        elif bingo[0][i] == bingo[1][i] == bingo[2][i] == 0:
            print("Yes")
            break
    else:
        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):
# d = [[0]*3] * 3

# a = [[i for i in map(int, input().split())] for j in range(3)]
# n = int(input())

a = [[66, 85, 92], [56, 37, 86], [7, 52, 23]]
n = 9
B = [30, 85, 52, 48,89, 92, 26, 5, 67]

d = [[0] * 3 for i in range(3)]
for i  in range(n):
    # b = int(input())
    b = B[i]
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                d[j][k] = 1
# if ans[0][0] + ans[0][1] + ans[0][2] == 3 or ans[1][0] + ans[1][1] + ans[1][2] == 3 or ans[2][0] + ans[2][1] + ans[2][2] == 3 or ans[0][0] + ans[1][0] + ans[2][0] == 3 or ans[0][1] + ans[1][1] + ans[2][1] == 3 or ans[0][2] + ans[1][2] + ans[2][2] == 3 or ans[0][0] + ans[1][1] + ans[2][2] == 3 or ans[0][2] + ans[1][1] + ans[2][0] == 3:
flag = False
for i in range(3):
    cnt = 0
    for j in range(3):
        cnt += d[i][j]
    if cnt == 3:
        flag = True

for i in range(3):
    cnt = 0
    for j in range(3):
        cnt += d[j][i]
    if cnt == 3:
        flag = True

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

cnt = 0
for i in range(3):
    cnt += d[i][2-i]
    if cnt == 3:
        flag = True
print("Yes") if flag == True else print('No')

a = [[i for i in map(int, input().split())] for j in range(3)]
n = int(input())

# a = [[66, 85, 92], [56, 37, 86], [7, 52, 23]]
# n = 9
# B = [30, 85, 52, 48,89, 92, 26, 5, 67]

d = [[0] * 3 for i in range(3)]
for i  in range(n):
    b = int(input())
    # b = B[i]
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                d[j][k] = 1

flag = False


for i in range(3):
    cnt = 0
    for j in range(3):
        cnt += d[i][j]
    if cnt == 3:
        flag = True

# vertical
for i in range(3):
    cnt = 0
    for j in range(3):
        cnt += d[j][i]
    if cnt == 3:
        flag = True

# diagonal 1
cnt = 0
for i in range(3):
    cnt += d[i][i]
    if cnt == 3:
        flag = True

# diagonal 2
cnt = 0
for i in range(3):
    cnt += d[i][2-i]
    if cnt == 3:
        flag = True
print("Yes") if flag == True 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):
a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for _ in range(N)]
A=[a0,a1,a2,a3,a4,a5,a6,a7,a8]

for i in range(N):
  for p in range(9):
    if b[i]=A[p]:
      A[p]=0
  
if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 0r A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0:
  print("Yes")
else:
  print("No")


a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for _ in range(N)]
A=[a0,a1,a2,a3,a4,a5,a6,a7,a8]

for i in range(N):
  for p in range(9):
    if b[i]=A[p]:
      A[p]=0
  
if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0:
  print("Yes")
else:
  print("No")


a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for _ in range(N)]
A=[a0,a1,a2,a3,a4,a5,a6,a7,a8]

for i in range(N):
  for p in range(9):
    if b[i]=A[p]:
      A=0
  
if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 0r A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0:
  print("Yes")
else:
  print("No")

a0,a1,a2=map(int,input().split())
a3,a4,a5=map(int,input().split())
a6,a7,a8=map(int,input().split())
N=int(input())
b=[int(input()) for _ in range(N)]
A=[a0,a1,a2,a3,a4,a5,a6,a7,a8]

for i in range(N):
  for p in range(9):
    if b[i]==A[p]:
      A[p]=0
  
if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0:
  print("Yes")
else:
  print("No")


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

import numpy as np

for i in range(3):
  a[i]=[1 if x in b else 0 for x in a[i]]   

s_1=max(np.sum(a,axis=0))
s_2=max(np.sum(a,axis=1))
s_3=a[0][0]+a[1][1]+a[2][2]
s_4=a[0][2]+a[1][1]+a[2][0]

if max(s_1,s_2,s_3,s_4)==3:
  print("Yes")
else:
  print("No")
print(a)

a=[list(map(int,input().split())) for _ in [0]*3]
n=int(input())
b=[int(input()) for _ in range(n)]

import numpy as np

for i in range(3):
  a[i]=[1 if x in b else 0 for x in a[i]]   

s_1=max(np.sum(a,axis=0))
s_2=max(np.sum(a,axis=1))
s_3=a[0][0]+a[1][1]+a[2][2]
s_4=a[0][2]+a[1][1]+a[2][0]

if max(s_1,s_2,s_3,s_4)==3:
  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 = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or boolean_matrix.sum(axis=0).max() >= 3 or np.diag(boolean_matrix).sum() >= 3 or np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
boolean_matrix.sum(axis=0).max() >= 3 or \
np.diag(boolean_matrix).sum() >= 3 or \
np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
   boolean_matrix.sum(axis=0).max() >= 3 or \
   np.diag(boolean_matrix).sum() >= 3 or \
   np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

import numpy as np
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = []
for j in range(N):
    b = int(input())
    B.append(b)
A = np.array(A)
B = np.array(B)
boolean_matrix = np.isin(A, B)
if boolean_matrix.sum(axis=1).max() >= 3 or \
   boolean_matrix.sum(axis=0).max() >= 3 or \
   np.diag(boolean_matrix).sum() >= 3 or \
   np.diag(np.fliplr(boolean_matrix)).sum() >= 3:
    print('Yes')
else:
    print('No')

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):
import collections as c
import sys
input = sys.stdin.readline
ip = lambda : map(int, input().split())
mod = 10**9+7
# ##############
A = []
for i in range(3):
    A.append(list(ip()))
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
print(A)
if sum(A[0]) == 0 or sum(A[1]) == 0 or sum(A[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[0][2] + A[1][1] + A[2][0] == 0):
    print('Yes')
else:print('No')

import collections as c
import sys
input = sys.stdin.readline
ip = lambda : map(int, input().split())
mod = 10**9+7
# ##############
A = []
for i in range(3):
    A.append(list(ip()))
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
# print(A)
if sum(A[0]) == 0 or sum(A[1]) == 0 or sum(A[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[0][2] + A[1][1] + A[2][0] == 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):
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
B = [list(map(int,input().split())) for i in range(N)]

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

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

for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            A[i][j] = 0
if A[0][0] == 0 and A[0][1] == 0 and A[0][2] == 0 or A[1][0] == 0 and A[1][1] == 0 and A[1][2] == 0 or A[2][0] == 0 and A[2][1] == 0 and A[2][2] == 0 or A[0][0] == 0 and A[1][0] == 0 and A[2][0] == 0 or A[0][1] == 0 and A[1][1] == 0 and A[2][1] == 0 or A[0][2] == 0 and A[1][2] == 0 and A[2][2] == 0 or A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0 or A[0][2] == 0 and A[1][1] == 0 and A[0][2] == 0:
    print("Yes")
else:
    print("No")

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

for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] in B[k]:
                A[i][j] = 0
if A[0][0] == 0 and A[0][1] == 0 and A[0][2] == 0 or A[1][0] == 0 and A[1][1] == 0 and A[1][2] == 0 or A[2][0] == 0 and A[2][1] == 0 and A[2][2] == 0 or A[0][0] == 0 and A[1][0] == 0 and A[2][0] == 0 or A[0][1] == 0 and A[1][1] == 0 and A[2][1] == 0 or A[0][2] == 0 and A[1][2] == 0 and A[2][2] == 0 or A[0][0] == 0 and A[1][1] == 0 and A[2][2] == 0 or A[0][2] == 0 and A[1][1] == 0 and A[0][2] == 0:
    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):
bingo = []
bingo[0] , bingo[1] , bingo[2] = map(int, input().split())
bingo[3] , bingo[4], bingo[5] = map(int, input().split())
bingo[6], bingo[7], bingo[8] = map(int, input().split())
n = int(input())
ls = []
counter = 0
for i in range(n):
  ls[i] = int(input())

for i in range(len(bingo)):
  for j in range(len(ls)):
    if ls[j] == bingo[i]:
      bingo[i] = 0
      break
for i in range(len(bingo)):
  if i == 0:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+4] + bingo[i+8] == 0:
      counter += 1
      break
  elif i == 1:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
  elif i == 2:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+2] + bingo[i+4] == 0:
      counter += 1
      break
  elif i == 3:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
  elif i == 6:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
if counter > 0:
  print("Yes")
else: 
  print("No")
  

bingo = [1,1,1,1,1,1,1,1,1]
bingo[0] , bingo[1] , bingo[2] = map(int, input().split())
bingo[3] , bingo[4], bingo[5] = map(int, input().split())
bingo[6], bingo[7], bingo[8] = map(int, input().split())
n = int(input())
ls = []
counter = 0
for i in range(n):
  ls.append(int(input()))
 
for i in range(len(bingo)):
  for j in range(len(ls)):
    if ls[j] == bingo[i]:
      bingo[i] = 0
      break
for i in range(len(bingo)):
  if i == 0:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+4] + bingo[i+8] == 0:
      counter += 1
      break
  elif i == 1:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
  elif i == 2:
    if bingo[i] + bingo[i+3] + bingo[i+6] == 0:
      counter += 1
      break
    elif bingo[i] + bingo[i+2] + bingo[i+4] == 0:
      counter += 1
      break
  elif i == 3:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
  elif i == 6:
    if bingo[i] + bingo[i+1] + bingo[i+2] == 0:
      counter += 1
      break
if counter > 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):
X = [[0 for i in range(3)] for j in range(3)]
for x in range(3):
    Y = list(map(int,input().split()))

    #print(Y[0])
    for y in range(3):
        X[x][y] = Y[y]
#        print(x,y,X[x][y],Y[y])
print(X)


N = int(input())
B = []
for x in range(N):
    B.append(int(input()))
#print(X)

for x in B:
    for y in range(3):
        for z in range(3):
            if(X[y][z] == x):
                X[y][z] = "Bingo"
ans = "No"
for x in range(3):
    if(X[x][0] == "Bingo" and X[x][1] == "Bingo" and X[x][2]):
        ans = "Yes"
    if(X[0][x] == "Bingo" and X[1][x] == "Bingo" and X[2][x]):
        ans = "Yes"
if(X[0][0] == "Bingo" and X[1][1] == "Bingo" and X[2][2]):
    ans = "Yes"
if(X[0][2] == "Bingo" and X[1][1] == "Bingo" and X[2][0]):
    ans = "Yes"
print(ans)

X = [[0 for i in range(3)] for j in range(3)]
for x in range(3):
    Y = list(map(int,input().split()))

    #print(Y[0])
    for y in range(3):
        X[x][y] = Y[y]
#        print(x,y,X[x][y],Y[y])
print(X)


N = int(input())
B = []
for x in range(N):
    B.append(int(input()))
#print(X)

for x in B:
    for y in range(3):
        for z in range(3):
            if(X[y][z] == x):
                X[y][z] = True
ans = "No"
for x in range(3):
    if(X[x][0] == True and X[x][1] == True and X[x][2] == True):
        ans = "Yes"
    if(X[0][x] == True and X[1][x] == True and X[2][x] == True):
        ans = "Yes"
if(X[0][0] == True and X[1][1] == True and X[2][2] == True):
    ans = "Yes"
if(X[0][2] == True and X[1][1] == True and X[2][0] == True):
    ans = "Yes"
print(ans)

X = [[0 for i in range(3)] for j in range(3)]
for x in range(3):
    Y = list(map(int,input().split()))

    #print(Y[0])
    for y in range(3):
        X[x][y] = Y[y]
#        print(x,y,X[x][y],Y[y])
#print(X)


N = int(input())
B = []
for x in range(N):
    B.append(int(input()))
#print(X)

for x in B:
    for y in range(3):
        for z in range(3):
            if(X[y][z] == x):
                X[y][z] = True
ans = "No"
for x in range(3):
    if(X[x][0] == True and X[x][1] == True and X[x][2] == True):
        ans = "Yes"
    if(X[0][x] == True and X[1][x] == True and X[2][x] == True):
        ans = "Yes"
if(X[0][0] == True and X[1][1] == True and X[2][2] == True):
    ans = "Yes"
if(X[0][2] == True and X[1][1] == True and X[2][0] == True):
    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):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]
print(A)

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

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

for i in range(3):
  for j in range(3):
    if A[i][j] in b:
      A[i][j] = 0
  
for i in range(3):
  if A[i][0] + A[i][1] + A[i][2] == 0 or A[0][i] + A[1][i] + A[2][i] == 0 or A[0][0]+A[1][1]+A[2][2] ==0 or A[2][0]+A[1][1]+A[0][2] ==0:
    judge += 1
  
  else:
    judge += 0
    
if judge >= 1:
  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):
for i in range(n):
    bb=int(input())
    for j in range(3):
        if bb==b1[j]:
            b1[j]=0
        elif bb==b2[j]:
            b2[j]=0
        elif bb==b3[j]:
            b3[j]=0
if sum(b1)==0 or sum(b2)==0 or sum(b3)==0:
    print("Yes")
elif b1[0]==b2[0]==b3[0]==0:
    print("Yes")
elif b1[1]==b2[1]==b3[1]==0:
    print("Yes")
elif b1[2]==b2[2]==b3[2]==0:
    print("Yes")

    
elif b1[0]==b2[1]==b3[2]==0:
    print("Yes")
elif b1[2]==b2[1]==b3[0]==0:
    print("Yes")
else:
    print("No")

b1=list(map(int,input().split()))
b2=list(map(int,input().split()))
b3=list(map(int,input().split()))
n=int(input())

for i in range(n):
    bb=int(input())
    for j in range(3):
        if bb==b1[j]:
            b1[j]=0
        elif bb==b2[j]:
            b2[j]=0
        elif bb==b3[j]:
            b3[j]=0
if sum(b1)==0 or sum(b2)==0 or sum(b3)==0:
    print("Yes")
elif b1[0]==b2[0]==b3[0]==0:
    print("Yes")
elif b1[1]==b2[1]==b3[1]==0:
    print("Yes")
elif b1[2]==b2[2]==b3[2]==0:
    print("Yes")
elif b1[0]==b2[1]==b3[2]==0:
    print("Yes")
elif b1[2]==b2[1]==b3[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):
matrix = []
for i in range(3):
    line = []
    line = input().split(" ")
    matrix.append(line)

n = int(input())
chosen = 0

for i in range(n):
    b = input()
    for i in range(3):
        for j in range(3):
            if matrix[i][j] == b:
                chosen += 1
                matrix[i][j] = 0
bingo = False
# Squares conditions
if (chosen == 8):
    for i in range(3):
        for j in range (3):
            if not (i == 1 and j == 1):
                if(matrix[i][j] != 0):
                    break
                if(i == 2 and j == 2):
                    bingo = True
elif (chosen >= 3):
    for i in range(3):
        if(matrix[i][0] == 0 and matrix[i][1] == 0 and matrix[i][2] == 0):
            bingo = True
            break
        elif(matrix[0][i] == 0 and matrix[1][i] == 0 and matrix[2][i] == 0):
            bingo = True
            break
    if(matrix[1][1] and (matrix[0][0] == 0 and matrix[2][2] == 0) or (matrix[0][2] == 0 and matrix[2][0] == 0)):
        bingo = True

if bingo:
    print("Yes")
else:
    print("No")


bingoSheet = [0 for x in range(9)]

for i in range(3):
    bingoRow = input().split()
    for j in range(3):
        bingoSheet[i*3 + j] = int(bingoRow[j])

bingoCount = int(input())

responses = []

for i in range(bingoCount):
    responses.append(int(input()))

hasBingo = False

step = 1
initialIndex = 0

for i in range(3):
    firstIndex = i*3
    subList = [bingoSheet[index] for index in [firstIndex, firstIndex+1, firstIndex+2]]
    if (all(elem in responses for elem in subList)):
        hasBingo = True
        break

for i in range(3):
    firstIndex = i
    subList = [bingoSheet[index] for index in [firstIndex, firstIndex+3, firstIndex+6]]
    if (all(elem in responses for elem in subList)):
        hasBingo = True
        break

subList = [bingoSheet[index] for index in [0, 4, 8]]
if (all(elem in responses for elem in subList)):
    hasBingo = True

subList = [bingoSheet[index] for index in [2, 4, 6]]
if (all(elem in responses for elem in subList)):
    hasBingo = True

if hasBingo:
    print('Yes')
    quit()

print('No')
quit()


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 main():
    import numpy as np

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

    is_bingo = False
    is_bingo = np.sum(card, axis=0).min() == 0
    is_bingo = np.sum(card, axis=1).min() == 0
    is_bingo = np.sum(np.diag(card)) == 0
    is_bingo = np.sum(np.diag(np.fliplr(card))) == 0

    print('Yes' if is_bingo else 'No')


if __name__ == '__main__':
    main()


def main():
    import numpy as np

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

    is_bingo = False
    is_row_bingo = np.sum(card, axis=0).min() == 0
    is_column_bingo = np.sum(card, axis=1).min() == 0
    is_diag_bingo1 = np.sum(np.diag(card)) == 0
    is_diag_bingo2 = np.sum(np.diag(np.fliplr(card))) == 0

    print('Yes' if is_row_bingo or is_column_bingo or is_diag_bingo1 or is_diag_bingo2 else '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):
A = [[j for j in list(map(int, input().split()))] for i in range(3)]
N = int(input())
B = []
for _ in range(N):
	b = int(input())
	for r in A:
		for i in range(len(r)):
			if r[i] == b:
				r[i] = 0
ans = False
for i in range(3):
	if sum(A[i]) == 0:
		ans = True
if not ans:
	for i in range(3):
		if A[0][i] + A[1][i] + A[2][i == 0:
			ans = True
if not ans:
	if A[0][0] + A[1][1] + A[2][2] == 0:
		ans = True
	elif A[0][2] + A[1][1] + A[2][0] == 0:
		ans = True
if ans:
	print('Yes')
else:
	print('No')


A = [[j for j in list(map(int, input().split()))] for i in range(3)]
N = int(input())
B = []
for _ in range(N):
	b = int(input())
	for r in A:
		for i in range(len(r)):
			if r[i] == b:
				r[i] = 0
ans = False
for i in range(3):
	if sum(A[i]) == 0:
		ans = True
if not ans:
	for i in range(3):
		if A[0][i] + A[1][i] + A[2][i] == 0:
			ans = True
if not ans:
	if A[0][0] + A[1][1] + A[2][2] == 0:
		ans = True
	elif A[0][2] + A[1][1] + A[2][0] == 0:
		ans = True
if ans:
	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):
import numpy as np

def run():
  A = [list(map(int, input().split())) for n in range(3)]
  A = np.array(A)
  N = int(input())
  for n in range(N):
    b = int(input())
    for i in range(3):
      for j in range(3):
        a = A[i][j]
        if a == b:
          A[i][j] = 0
  print(A)
  ans = 1
  left = 0
  right = 0
  for i in range(3):
    ans = min(ans, np.sum(A, axis=0)[i])
    ans = min(ans, np.sum(A, axis=1)[i])
    left += A[i][i]
    right += A[i][2-i]
  ans = min(ans, left, right)
  if ans == 0:
    print('Yes')
  else:
    print('No')
    

if __name__ == '__main__':
  run()


import numpy as np

def run():
  A = [list(map(int, input().split())) for n in range(3)]
  A = np.array(A)
  N = int(input())
  for n in range(N):
    b = int(input())
    for i in range(3):
      for j in range(3):
        a = A[i][j]
        if a == b:
          A[i][j] = 0
  ans = 1
  left = 0
  right = 0
  for i in range(3):
    ans = min(ans, np.sum(A, axis=0)[i])
    ans = min(ans, np.sum(A, axis=1)[i])
    left += A[i][i]
    right += A[i][2-i]
  ans = min(ans, left, right)
  if ans == 0:
    print('Yes')
  else:
    print('No')
    

if __name__ == '__main__':
  run()


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
def main():
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = list(map(int, input().split()))
    A = [a,b,c]
    n = int(input())
    B = []
    C = []
    for i in range(n):
        B.append(int(input()))
    for i in range(3):
        for j in range(3):
            if A[i][j] in B:
                C.append(i*10 + j)
    if 0 and 1 and 2 in C:
        print("Yes")
    elif 10 and 11 and 12 in C:
        print("Yes")
    elif 20 and 21 and 22 in C:
        print("Yes")
    elif 0 and 10 and 20 in C:
        print("Yes")
    elif 1 and 11 and 21 in C:
        print("Yes")
    elif 2 and 12 and 22 in C:
        print("Yes")
    elif 0 and 11 and 22 in C:
        print("Yes")
    else:
        print("No")
    

# coding: utf-8
def main():
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = list(map(int, input().split()))
    A = [a,b,c]
    n = int(input())
    B = []
    C = []
    for i in range(n):
        B.append(int(input()))
    for i in range(3):
        for j in range(3):
            if A[i][j] in B:
                C.append(i*10 + j)
    D = []
    if 0 in C:
        D += [1,4,7]
    if 1 in C:
        D += [1,5]
    if 2 in C:
        D += [1,6,8]
    if 10 in C:
        D += [2,4]
    if 11 in C:
        D += [2,5,7,8]
    if 12 in C:
        D += [2,6]
    if 20 in C:
        D += [3,4,8]
    if 21 in C:
        D += [3,5]
    if 22 in C:
        D += [3,6,7]
    for i in range(1,9):
        if D.count(i) == 3:
            print("Yes")
            quit()
    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):
a=[]
for i in range(3):
    a.append(list(map(int,input().split())))
n=input()
for i in range(n):
    b=int(input())
    for j in range(3):
        for k in range(3):
            if a[i][j]==b:
                a[i][j]=0

ans=0
for l in range(3):
    if a[l][0]==0 and a[l][1]==0 and a[l][2]==0:
        ans=1
        break
    elif a[0][l]==0 and a[1][l==0 and a[2][l]==:
        ans=1
        break

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


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[k][j]==b:
                a[k][j]=0

ans=0
for l in range(3):
    if a[l][0]==0 and a[l][1]==0 and a[l][2]==0:
        ans=1
        break
    elif a[0][l]==0 and a[1][l]==0 and a[2][l]==0:
        ans=1
        break




if ans==1:
    print("Yes")
elif a[1][1]==0 and a[2][2]==0 and a[0][0]==0:
    print("Yes")
elif a[0][2]==0 and a[1][1]==0 and 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):
a = [input().split() for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
total = []
s = 0
 
for i in range(n):
  for k in range(3):
    for j in range(3):
      if b[i] == int(a[k][j]):
        total.append(s + j)
    s = s + 3
if ((0 and 1 and 2) in total) or ((3 and 4 and 5) in total) or ((6 and 7 and 8) in total) or ((0 and 3 and 6) in total) or ((1 and 4 and 7) in total) or ((2 and 5 and 8) in total) or ((0 and 4 and 8) in total) or ((2 and 4 and 6) in total):
  print("Yes")
else:
  print("No")

a = [input().split() for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
total = []
s = 0
 
for i in range(n):
  for k in range(3):
    for j in range(3):
      if b[i] == int(a[k][j]):
        if k < 1: 
          total.append(s + j)
        else:
          total.append(k + j)
    s = s + 3
if ((0 and 1 and 2) in total) or ((3 and 4 and 5) in total) or ((6 and 7 and 8) in total) or ((0 and 3 and 6) in total) or ((1 and 4 and 7) in total) or ((2 and 5 and 8) in total) or ((0 and 4 and 8) in total) or ((2 and 4 and 6) in total):
  print("Yes")
else:
  print("No")

a = [input().split() for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
total = []
 
for i in range(n):
  for k in range(3):
    for j in range(3):
      if b[i] == int(a[k][j]):
          total.append(k * 3 + j)
          
if 0 in total and 1 in total and 2 in total: 
  print("Yes")
elif 3 in total and 4 in total and 5 in total: 
  print("Yes")
elif 6 in total and 7 in total and 8 in total: 
  print("Yes")
elif 0 in total and 3 in total and 6 in total: 
  print("Yes")
elif 1 in total and 4 in total and 7 in total: 
  print("Yes")
elif 2 in total and 5 in total and 8 in total: 
  print("Yes")
elif 0 in total and 4 in total and 8 in total: 
  print("Yes")
elif 2 in total and 4 in total and 6 in total: 
  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):
# Atcoder ABC 157


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

n = int(input())

for _ in range(n):  #b_n roop
   b = int(input())
   for i in range(3):
    for j in range(3):
      if b == a[i][j]:
        a[i][j] == 0  #make a 0
        
for i in range(3):
    if sum(a[i]) == 0: 
     print("Yes")
     exit()
    if sum(a[0][i],a[1][i],a[2][i]) == 0: 
     print("Yes")
     exit()

if sum(a[0][0],a[1][1],a[2][2]) == 0: 
    print("Yes")
    exit()

if sum(a[2][0],a[1][1],a[0][2]) == 0: 
    print("Yes")
    exit()


print("No")

# Atcoder ABC 157


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

n = int(input())

for _ in range(n):  #b_n roop
   b = int(input())
   for i in range(3):
    for j in range(3):
      if b == a[i][j]:
        a[i][j] = 0  #make a 0
        
for i in range(3):
    if sum(a[i]) == 0: 
     print("Yes")
     exit()
    if sum([a[0][i], a[1][i], a[2][i]]) == 0: 
     print("Yes")
     exit()

if sum([a[0][0], a[1][1], a[2][2]]) == 0: 
    print("Yes")
    exit()

if sum([a[2][0], a[1][1], a[0][2]]) == 0: 
    print("Yes")
    exit()



# Atcoder ABC 157


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

n = int(input())

for _ in range(n):  #b_n roop
   b = int(input())
   for i in range(3):
    for j in range(3):
      if b == a[i][j]:
        a[i][j] = 0  #make a 0
        
for i in range(3):
    if sum(a[i]) == 0: 
     print("Yes")
     exit()
    if sum(a[0][i],a[1][i],a[2][i]) == 0: 
     print("Yes")
     exit()

if sum(a[0][0],a[1][1],a[2][2]) == 0: 
    print("Yes")
    exit()

if sum(a[2][0],a[1][1],a[0][2]) == 0: 
    print("Yes")
    exit()


print("No")

# Atcoder ABC 157


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

n = int(input())

for _ in range(n):  #b_n roop
   b = int(input())
   for i in range(3):
    for j in range(3):
      if b == a[i][j]:
        a[i][j] = 0  #make a 0
        
for i in range(3):
    bingo = False
    if sum(a[i]) == 0: 
     print("Yes")
     exit()
    if sum([a[0][i], a[1][i], a[2][i]]) == 0: 
     print("Yes")
     exit()

if sum([a[0][0], a[1][1], a[2][2]]) == 0: 
    print("Yes")
    exit()

if sum([a[2][0], a[1][1], a[0][2]]) == 0: 
    print("Yes")
    exit()


print("No")

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):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))

A = A1 + A2 + A3
N = int(input())

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

if (0 in index and 3 in index and 6 in index) or \
   (1 in index and 4 in index and 7 in index) or \
   (2 in index and 5 in index and 8 in index) or \
   (0 in index and 4 in index and 8 in index) or \
   (2 in index and 4 in index and 6 in index) or \
   (3 in index and 4 in index and 5 in index) or \
   (6 in index and 7 in index and 8 in index):
    print("Yes")
else:
    print("No")


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

A = A1 + A2 + A3
N = int(input())

index = []
for i in range(N):
    inp = int(input())
    if inp in A:
        index.append(A.index(inp))

if \
   (0 in index and 3 in index and 6 in index) or \
   (1 in index and 4 in index and 7 in index) or \
   (2 in index and 5 in index and 8 in index) or \
   (0 in index and 4 in index and 8 in index) or \
   (2 in index and 4 in index and 6 in index) or \
   (0 in index and 1 in index and 2 in index) or \
   (3 in index and 4 in index and 5 in index) or \
   (6 in index and 7 in index and 8 in index):
    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 = [0]*3
b = [0]*N
for i in range(0, 3):
    A[i] = list(map(int, input().split()))
N = int(input())
for i in range(0, N):
    b[i] = int(input())
for i in range(0, 3):
    for j in range(0, 3):
        for k in range(0, N):
            if A[i][j] == b[k]:
                A[i][j] = 0
if A[0] == [0, 0, 0] or A[1] == [0, 0, 0] or A[2] == [0, 0, 0]:
    print ("Yes")
elif A[0][0] == A[1][0] == A[2][0] == 0:
    print ("Yes")
elif A[0][1] == A[1][1] == A[2][1] == 0:
    print ("Yes")
elif A[0][2] == A[1][2] == A[2][2] == 0:
    print ("Yes")
elif A[0][0] == A[1][1] == A[2][2] == 0:
    print ("Yes")
elif A[0][2] == A[1][1] == A[2][0] == 0:
    print ("Yes")
else:
    print ("No")

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

A = [0]*3
for i in range(0, 3):
    A[i] = list(map(int, input().split()))
N = int(input())
b = [0]*N
for i in range(0, N):
    b[i] = int(input())
for i in range(0, 3):
    for j in range(0, 3):
        for k in range(0, N):
            if A[i][j] == b[k]:
                A[i][j] = 0
if A[0] == [0, 0, 0] or A[1] == [0, 0, 0] or A[2] == [0, 0, 0]:
    print ("Yes")
elif A[0][0] == A[1][0] == A[2][0] == 0:
    print ("Yes")
elif A[0][1] == A[1][1] == A[2][1] == 0:
    print ("Yes")
elif A[0][2] == A[1][2] == A[2][2] == 0:
    print ("Yes")
elif A[0][0] == A[1][1] == A[2][2] == 0:
    print ("Yes")
elif A[0][2] == A[1][1] == A[2][0] == 0:
    print ("Yes")
else:
    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):
A = [list(map(int, input().split())) for _ in range(3)]
n = input()
B = list(map(int, input().split()))
ans = False

bingolist = []
for i in range(3):
  bingolist.append([A[i][0], A[i][1], A[i][2]])
  bingolist.append([A[0][i], A[1][i], A[2][i]])

bingolist.append([A[0][0], A[1][1], A[2][2]])
bingolist.append([A[2][0], A[1][1], A[0][2]])

for i in bingolist:
  ans = True if (i[0] in B and i[1] in B and i[2] in B)
  
print(ans)

A = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
B = [int(input()) for _ in range(n)]
ans = False

bingolist = []
for i in range(3):
  bingolist.append([A[i][0], A[i][1], A[i][2]])
  bingolist.append([A[0][i], A[1][i], A[2][i]])

bingolist.append([A[0][0], A[1][1], A[2][2]])
bingolist.append([A[2][0], A[1][1], A[0][2]])

for i in bingolist:
  if i[0] in B and i[1] in B and i[2] in B: ans = True
  
print("Yes" if ans else "No")


Verdicts: Runtime Error

Accepted