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 _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]
S=[[0,0,0] for _ in range(3)]
for b in B:
  for i in range(3):
    if b in A[i]:
      S[i][A[i].index(b)] = 1
      break
p = False
for a in S:
  if sum(a)==3:
    p = True
    break
if not p:
  for i in range(3):
    if S[0][i]+S[1][i]+S[2][i]==3:
      p = True
      break
if not p:
  if S[0][0]+S[1][1]+S[2][2]==3 or S[2][0]+S[1][1]+S[0][2]==3:
    p=True
print("Yes" if p else "No")
print(S)

A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]
S=[[0,0,0] for _ in range(3)]
for b in B:
  for i in range(3):
    if b in A[i]:
      S[i][A[i].index(b)] = 1
      break
p = False
for a in S:
  if sum(a)==3:
    p = True
    break
if not p:
  for i in range(3):
    if S[0][i]+S[1][i]+S[2][i]==3:
      p = True
      break
print("Yes" if p else "No")

A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]
S=[[0,0,0] for _ in range(3)]
for b in B:
  for i in range(3):
    if b in A[i]:
      S[i][A[i].index(b)] = 1
      break
p = False
for a in S:
  if sum(a)==3:
    p = True
    break
if not p:
  for i in range(3):
    if S[0][i]+S[1][i]+S[2][i]==3:
      p = True
      break
if not p:
  if S[0][0]+S[1][1]+S[2][2]==3 or S[2][0]+S[1][1]+S[0][2]==3:
    p=True
print("Yes" if p else "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 itertools

A = [input().split() for _ in range(3)]
A = list(itertools.chain.from_iterable(A))
N = int(input())
B = [input() for _ in range(N)]

l = [a in B for a in A]
print(l)
if l[0] == l[1] == l[2]:
    print("Yes")
elif l[3] == l[4] == l[5]:
    print("Yes")
elif l[6] == l[7] == l[8]:
    print("Yes")
elif l[0] == l[3] == l[6]:
    print("Yes")
elif l[1] == l[4] == l[7]:
    print("Yes")
elif l[2] == l[5] == l[8]:
    print("Yes")
elif l[0] == l[4] == l[8]:
    print("Yes")
elif l[2] == l[4] == l[6]:
    print("Yes")
else:
    print("No")

import itertools

A = [input().split() for _ in range(3)]
A = list(itertools.chain.from_iterable(A))
N = int(input())
B = [input() for _ in range(N)]

l = [a in B for a in A]
if l[0] == l[1] == l[2] == True:
    print("Yes")
elif l[3] == l[4] == l[5] == True:
    print("Yes")
elif l[6] == l[7] == l[8] == True:
    print("Yes")
elif l[0] == l[3] == l[6] == True:
    print("Yes")
elif l[1] == l[4] == l[7] == True:
    print("Yes")
elif l[2] == l[5] == l[8] == True:
    print("Yes")
elif l[0] == l[4] == l[8] == True:
    print("Yes")
elif l[2] == l[4] == l[6] == True:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a=[list(input().split()) for i in range(3)]

n=int(input())

b=list(int(input()) for i in range(n))

c=[[0]*3 for i in range(3)]

for i in range(3):
    for j in range(3):
        c[i][j]=False
        for k in range(n):
            if a[i][j]==b[k]:
                c[i][j]=True

answer="No"

for i in range(3):
    if (c[i][0] and c[i][1] and c[i][2]):
        answer="Yes"
    if (c[0][i] and c[1][i] and c[2][i]):
        answer="Yes"
if (c[0][0] and c[1][1] and c[2][2]):
    answer="Yes"
if (c[0][2] and c[1][1] and c[2][0]):
    answer="Yes"

print(answer)

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

n=int(input())

b=list(int(input()) for i in range(n))

c=[[0]*3 for i in range(3)]

for i in range(3):
    for j in range(3):
        c[i][j]=False
        for k in range(n):
            if a[i][j]==b[k]:
                c[i][j]=True

answer="No"

for i in range(3):
    if (c[i][0] and c[i][1] and c[i][2]):
        answer="Yes"
    if (c[0][i] and c[1][i] and c[2][i]):
        answer="Yes"
if (c[0][0] and c[1][1] and c[2][2]):
    answer="Yes"
if (c[0][2] and c[1][1] and c[2][0]):
    answer="Yes"

print(answer)

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
import numpy as np

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

n = int(input())

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

hit = np.isin(card, number)

row = hit.all(axis=0).any()
col = hit.all(axis=1).any()

diag1 = hit[0][0] and hit[1][1] and hit[2][2]
diag2 = hit[0][2] and hit[1][1] and hit[2][0]

print('yes' if row or col or diag1 or diag2 else 'no')

import numpy as np

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

n = int(input())

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

hit = np.vectorize(lambda x: x in number)(card)

row = hit.all(axis=0).any()
col = hit.all(axis=1).any()

diag1 = hit[0][0] and hit[1][1] and hit[2][2]
diag2 = hit[0][2] and hit[1][1] and hit[2][0]

print('Yes' if row or col or diag1 or diag2 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):
s = 3
arr =[]
for _ in range(s):
        arr.append(list(map(int, input().rstrip().split())))
print(arr)

check = [[0,0,0],[0,0,0],[0,0,0]]
#print(check)


N = int(input())
#print(N)

for i in range(N):
    data = int(input())
    for k in range(3):
        for j in range(3):
            if data == arr[j][k]:
                check[j][k]= 1
#print(check)


answer = "No"
for k in range(3):
    if check[k][0] == 1 and check[k][1]== 1 and check[k][2] == 1:
        answer = "Yes"

for j in range(3):
    if check[0][j] == 1 and check[1][j] == 1 and check[2][j] == 1:
        answer = "Yes"

if check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1:
    answer = "Yes"

if check[0][2] == 1 and check[1][1] == 1 and check[2][0] == 1:
    answer = "Yes"


print(answer)

H = [[0] * 3 for i in range(3)]
A = [[0] * 3 for i in range(3)]

A[0][0],A[0][1],A[0][2] = map(int,input().split())
A[1][0],A[1][1],A[1][2] = map(int,input().split())
A[2][0],A[2][1],A[2][2] = map(int,input().split())

N = int(input())
for i in range(N):
	ball = int(input())
	for l in range(3):
		for c in range(3):
			if A[l][c] == ball:
				H[l][c] = 1
#print(H)
flag = 0
for l in range(3):
	if H[l][0] ==1 and H[l][1] ==1  and H[l][2] ==1:
		flag =1

for c in range(3):
	if H[0][c] ==1 and H[1][c] ==1  and H[2][c] ==1:
		flag =1

if H[0][0]==1 and H[1][1]==1 and H[2][2]== 1:
	flag = 1

if H[2][0]==1 and H[1][1]==1 and H[0][2]== 1:
	flag = 1

if flag == 1:
	print("Yes")
else:
	print("No")
#A[2][1] = 10
#print(A)
#print(flag)

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a = [input().split() for l in range(3)]

n=int(input())
b = [(input()) for i in range(n)]
s=[]
for i in range(n):
  for j in range(3):
    if b[i] in a[j]:
      k=a[j].index(b[i])
      s.append([j,k])
      if [j,0] in s and [j,1] in s and [j,2] in s:
        print("YES")
        break
      elif [0,k] in s and [1,k] in s and [2,k] in s:
        print("YES")
        break
      elif j==k:
        if [0,0] in s and [1,1] in s and [2,2] in s:
          print("YES")
          break
        elif [0,2] in s and [1,1] in s and [2,0] in s:
          print("YES")
          break
  else:
    continue
  break
else:
  print("NO")

a = [input().split() for l in range(3)]

n=int(input())
b = [(input()) for i in range(n)]
s=[]
for i in range(n):
  for j in range(3):
    if b[i] in a[j]:
      k=a[j].index(b[i])
      s.append([j,k])
      if [j,0] in s and [j,1] in s and [j,2] in s:
        print("YES")
        break
      elif [0,k] in s and [1,k] in s and [2,k] in s:
        print("YES")
        break
      elif j==k:
        if [0,0] in s and [1,1] in s and [2,2] in s:
          print("YES")
          break
        elif [0,2] in s and [1,1] in s and [2,0] in s:
          print("YES")
          break
  else:
    continue
  break
else:
  print("NO")

a = [input().split() for l in range(3)]

n=int(input())
b = [(input()) for i in range(n)]
s=[]
for i in range(n):
  for j in range(3):
    if b[i] in a[j]:
      k=a[j].index(b[i])
      s.append([j,k])
      if [j,0] in s and [j,1] in s and [j,2] in s:
        print("Yes")
        break
      elif [0,k] in s and [1,k] in s and [2,k] in s:
        print("Yes")
        break
      elif j==k:
        if [0,0] in s and [1,1] in s and [2,2] in s:
          print("Yes")
          break
        elif [0,2] in s and [1,1] in s and [2,0] in s:
          print("Yes")
          break
  else:
    continue
  break
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):
A=[]
for i in range(3):
  A.append(list(map(int, input().split())))  

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

#print(A)


match = []
for A_line in A:
  match.append([(a in B) for a in A_line])

#print(match)
ans = False

for m in match:
  ans = ans or all(m)


match_v = [[m[i] for m in match] for i in range(3)]
#print(match_v)
for m in match_v:
  ans = ans or all(m)

ans = ans or all([match[i][i] for i in range(3)])
ans = ans or all([match[2-i][i] for i in range(3)])

print(ans)

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

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

#print(A)


match = []
for A_line in A:
  match.append([(a in B) for a in A_line])

#print(match)
ans = False

for m in match:
  ans = ans or all(m)


match_v = [[m[i] for m in match] for i in range(3)]
#print(match_v)
for m in match_v:
  ans = ans or all(m)

ans = ans or all([match[i][i] for i in range(3)])
ans = ans or all([match[2-i][i] for i in range(3)])

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

Verdicts: Wrong Answer

Accepted
Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
B = [int(input()) for i in range(N)]
ans = 0
for i in range(3):
  for j in range(3):
    for k in B:
      if A[i][j] == k:
        A[i][j] = 1
print(A)
for i in range(3):
  if A[i].count(1) == 3:
    ans += 1
  elif A[0][i] == 1 and A[2][i] == 1 and A[2][i] == 1:
    ans += 1
if A[0][0] == 1 and A[1][1] == 1 and A[2][2] == 1:
  ans += 1
elif A[0][2] == 1 and A[1][1] == 1 and A[2][0] == 1:
  ans += 1
elif ans > 1:
  print("Yes")
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)]
ans = 0
for i in range(3):
  for j in range(3):
    for k in B:
      if A[i][j] == k:
        A[i][j] = 1
for i in range(3):
  if A[i].count(1) == 3:
    ans += 1
  elif A[0][i] == 1 and A[2][i] == 1 and A[2][i] == 1:
    ans += 1
if A[0][0] == 1 and A[1][1] == 1 and A[2][2] == 1:
  ans += 1
elif A[0][2] == 1 and A[1][1] == 1 and A[2][0] == 1:
  ans += 1
elif ans > 1:
  print("Yes")
else:
  print("No")


a = []
[a.append(list(map(int, input().split()))) for _ in range(3)]
n = int(input())
b = [int(input())for _ in range(n)]
for i in b:
  for j in range(3):
    for k in range(3):
      if a[j][k] == i:
        a[j][k] = 1
ans = 0
count =0
for j in range(3):
  if a[j].count(1) == 3:
    ans += 1
  elif (a[0][j] == a[1][j] == a[2][j]) == 1:
    ans += 1
  elif (a[0][0] == a[1][1] == a[2][2]) == 1:
    ans += 1
  elif (a[0][2] == a[1][1] == a[2][0]) == 1:
    ans += 1
if ans > 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):
a=[list(map(int,input().split())) for i in range(3)]
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
 
for i in range(3):
    flag=True
    for j in range(3):
        if a[i][j]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()
 
for i in range(3):
    flag=True
    for j in range(3):
        if a[j][i]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()
 
for i in range(3):
    flaf=True
    if a[i][i]!=0:
        flag=False
if flag:
    print("Yes")
    exit()
 
for i in range(3):
    if a[i][2-i]!=0:
        print("No")
        exit()
print("Yes")
exit()

a=[list(map(int,input().split())) for i in range(3)]
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
 
for i in range(3):
    flag=True
    for j in range(3):
        if a[i][j]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()
 
for i in range(3):
    flag=True
    for j in range(3):
        if a[j][i]!=0:
            flag=False
    if flag:
        print("Yes")
        exit()

flag=True
for i in range(3):
    if a[i][i]!=0:
        flag=False
if flag:
    print("Yes")
    exit()
 
for i in range(3):
    if a[i][2-i]!=0:
        print("No")
        exit()
print("Yes")
exit()

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):
Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[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):
elif Aij[0][0]=='0' and Aij[0][1]=='0' and Aij[0][2]=='0':
    print('Yes')
elif Aij[1][0]=='0' and Aij[1][1]=='0' and Aij[1][2]=='0':
    print('Yes')
elif Aij[2][0]=='0' and Aij[2][1]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[2][0]=='0':
    print('Yes')
else:
    print('No')

Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[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):
    print('Yes')
elif Aij[0][0]=='0' and Aij[0][1]=='0' and Aij[0][2]=='0':
    print('Yes')
elif Aij[1][0]=='0' and Aij[1][1]=='0' and Aij[1][2]=='0':
    print('Yes')
elif Aij[2][0]=='0' and Aij[2][1]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[2][0]=='0':
    print('Yes')
else:
    print('No')

Aij= [input().split() for l in range(3)]
N=int(input())
b= [int(input()) for i in range(N)]
for j in range(3):
    for k in range(3):
        for n in range(N):
            if int(Aij[j][k])==b[n]:
                Aij[j][k]='0'
if Aij[0].count('0')==3 or Aij[1].count('0')==3 or Aij[2].count('0')==3:
    print('Yes')
elif Aij[0][0]=='0' and Aij[1][0]=='0' and Aij[2][0]=='0':
    print('Yes')
elif Aij[0][1]=='0' and Aij[1][1]=='0' and Aij[2][1]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][2]=='0' and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][0]=='0'and Aij[1][1]=='0'and Aij[2][2]=='0':
    print('Yes')
elif Aij[0][2]=='0' and Aij[1][1]=='0'and Aij[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):

li1 = list(map(int,input().split()))
li1.extend(list(map(int,input().split())))
li1.extend(list(map(int,input().split())))
n = int(input())
for i in range(n):
  p = int(input())
  li1 = [0 if j == p else j for j in li1]
print(li1)
if ( li1[0] + li1[1] + li1[2] ) == 0:
  print('Yes')
elif ( li1[3] + li1[4] + li1[5] ) == 0:
  print('Yes')
elif ( li1[6] + li1[7] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[3] + li1[6] ) == 0:
  print('Yes')
elif ( li1[1] + li1[4] + li1[7] ) == 0:
  print('Yes')
elif ( li1[2] + li1[5] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[4] + li1[8] ) == 0:
  print('Yes')
elif ( li1[2] + li1[4] + li1[6] ) == 0:
  print('Yes')
else:
  print('No')

li1 = list(map(int,input().split()))
li1.extend(list(map(int,input().split())))
li1.extend(list(map(int,input().split())))
n = int(input())
for i in range(n):
  p = int(input())
  li1 = [0 if j == p else j for j in li1]
if ( li1[0] + li1[1] + li1[2] ) == 0:
  print('Yes')
elif ( li1[3] + li1[4] + li1[5] ) == 0:
  print('Yes')
elif ( li1[6] + li1[7] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[3] + li1[6] ) == 0:
  print('Yes')
elif ( li1[1] + li1[4] + li1[7] ) == 0:
  print('Yes')
elif ( li1[2] + li1[5] + li1[8] ) == 0:
  print('Yes')
elif ( li1[0] + li1[4] + li1[8] ) == 0:
  print('Yes')
elif ( li1[2] + li1[4] + li1[6] ) == 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):
al = [map(int, input().split()) for i in range(3)]
n = int(input())
bl = [int(input()) for i in range(n)]
check = [0 for i in range(9)]

for b in bl:
    if b in al:
        check[al.index(b)] = 1

if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[0:9:4], check[3:8:2]]:
    print("Yes")
else:
    print("No")


al = [list(map(int, input().split())) for i in range(3)]
al = sum(a, [])
n = int(input())
bl = [int(input()) for i in range(n)]
check = [0 for i in range(9)]

for b in bl:
    if b in al:
        check[al.index(b)] = 1

if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[0:9:4], check[3:8:2]]:
    print("Yes")
else:
    print("No")

al = [list(map(int, input().split())) for i in range(3)]
al = sum(al, [])
n = int(input())
bl = [int(input()) for i in range(n)]
check = [0 for i in range(9)]

for b in bl:
    if b in al:
        check[al.index(b)] = 1

if [1,1,1] in [check[:3], check[3:6], check[6:], check[0:7:3], check[1:8:3], check[2:9:3], check[0:9:4], check[2:8:2]]:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

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

mat = []

for i in range(3):
	(a,b,c)= input().split(' ')
	mat.append((int(a),int(b),int(c)))

mat = np.array(mat).reshape(3,3)


num = int(input())
ball=[]
for i in range(num):
  ball.append(int(input()))

ball = set(ball)

for h in range(3):
  x = set(mat[h,:])
  res = ball.intersection(x) == x
  if res:
    print(res)
    exit()

for w in range(3):
  x = set(mat[:, w])
  res = ball.intersection(x) == x
  if res:
    print(res)
    exit()

x = {mat[0,0],mat[1,1], mat[2,2]}
res = ball.intersection(x) == x
if res:
  print(res)
  exit()

x = {mat[2,0],mat[1,1], mat[0,2]}  
res = ball.intersection(x) == x
if res:
  print(res)
  exit()
  
print(res)

import numpy as np

mat = []

for i in range(3):
	(a,b,c)= input().split(' ')
	mat.append((int(a),int(b),int(c)))

mat = np.array(mat).reshape(3,3)


num = int(input())
ball=[]
for i in range(num):
  ball.append(int(input()))

ball = set(ball)

for h in range(3):
  x = set(mat[h,:])
  res = ball.intersection(x) == x
  if res:
    print('Yes')
    exit()

for w in range(3):
  x = set(mat[:, w])
  res = ball.intersection(x) == x
  if res:
    print('Yes')
    exit()

x = {mat[0,0],mat[1,1], mat[2,2]}
res = ball.intersection(x) == x
if res:
  print('Yes')
  exit()

x = {mat[2,0],mat[1,1], mat[0,2]}  
res = ball.intersection(x) == x
if res:
  print('Yes')
  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):
/* 
 * Created by solzard on 2020-03-05.
 * 
 */





bool is_bingo(int player) {
  std::unordered_set<int> winnable_conditions
      {0b111000000, 0b000111000, 0b000000111, 0b100100100, 0b010010010, 0b001001001, 0b100010001, 0b001010100};
  for (const auto &condition : winnable_conditions) {
    if ((player & condition) == condition) return true;
  }
  return false;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);

  std::vector<int> sheet;
  std::unordered_set<int> bingo;
  int a, n, b;
  rep(_, 9) {
    std::cin >> a;
    sheet.emplace_back(a);
  }
  std::cin >> n;
  rep(_, n) {
    std::cin >> b;
    bingo.emplace(b);
  }
  int player = 0;
  rep(i, 9) {
    if (bingo.find(sheet[i]) != bingo.end()) {
      player |= 1 << i;
    }
  }
  std::cout << (is_bingo(player) ? "Yes" : "No") << "\n";
}


/* 
 * Created by solzard on 2020-03-05.
 * 
 */


#include <algorithm>



bool is_bingo(int player) {
  std::unordered_set<int> winnable_conditions
      {0b111000000, 0b000111000, 0b000000111, 0b100100100, 0b010010010, 0b001001001, 0b100010001, 0b001010100};
  for (const auto &condition : winnable_conditions) {
    if ((player & condition) == condition) return true;
  }
  return false;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);

  std::vector<int> sheet;
  std::unordered_set<int> bingo;
  int a, n, b;
  rep(_, 9) {
    std::cin >> a;
    sheet.emplace_back(a);
  }
  std::cin >> n;
  rep(_, n) {
    std::cin >> b;
    bingo.emplace(b);
  }
  int player = 0;
  rep(i, 9) {
    if (bingo.find(sheet[i]) != std::end(bingo)) {
      player |= 1 << i;
    }
  }
  std::cout << (is_bingo(player) ? "Yes" : "No") << "\n";
}



# B - Bingo
def is_winnable(player: int) -> bool:
    winnable_conditions = \
        {0b111000000, 0b000111000, 0b000000111, 0b100100100, 0b010010010, 0b001001001, 0b100010001, 0b001010100}
    return any(player & condition == condition for condition in winnable_conditions)


def main():
    *ANB, = map(int, open(0).read().split())
    A, B = ANB[:9], set(ANB[10:])
    player = 0b000000000
    for i, a in enumerate(A):
        if a in B:
            player |= 1 << i
    print("Yes" if is_winnable(player) else "No")


if __name__ == "__main__":
    main()


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

aListCheck = []
for i in range(3):
  aListCheckRow = []
  for j in range(3):
    aListCheckRow.append(aList[i][j] in bList)
  aListCheck.append(aListCheckRow)

for i in range(3):
  if aListCheck[i][0] and aListCheck[i][1] and aListCheck[i][2]:
    print('YES')
    exit()
  if aListCheck[0][i] and aListCheck[1][i] and aListCheck[2][i]:
    print('YES')
    exit()
if aListCheck[0][0] and aListCheck[1][1] and aListCheck[2][2]:
  print('YES')
  exit()
if aListCheck[0][2] and aListCheck[1][1] and aListCheck[2][0]:
  print('YES')
  exit()

print('No')

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

aListCheck = []
for i in range(3):
  aListCheckRow = []
  for j in range(3):
    aListCheckRow.append(aList[i][j] in bList)
  aListCheck.append(aListCheckRow)

for i in range(3):
  if aListCheck[i][0] and aListCheck[i][1] and aListCheck[i][2]:
    print('Yes')
    exit()
  if aListCheck[0][i] and aListCheck[1][i] and aListCheck[2][i]:
    print('Yes')
    exit()
if aListCheck[0][0] and aListCheck[1][1] and aListCheck[2][2]:
  print('Yes')
  exit()
if aListCheck[0][2] and aListCheck[1][1] and aListCheck[2][0]:
  print('Yes')
  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):
list1 = input().split(" ")
list2 = input().split(" ")
list3 = input().split(" ")
count = int(input())
vlist1 = [list1[0],list2[0],list3[0]]
vlist2 = [list1[1],list2[1],list3[1]]
vlist3 = [list1[2],list2[2],list3[2]]
xlist1 = [list1[0],list2[1],list3[2]]
xlist2 = [list1[2],list2[1],list3[0]]
correct = ['o','o','o']
answer = "no"

for i in range(count):
	num = input()
	list1 = ['o' if num in s else s for s in list1]
	list2 = ['o' if num in s else s for s in list2]
	list3 = ['o' if num in s else s for s in list3]
	vlist1 = [list1[0],list2[0],list3[0]]
	vlist2 = [list1[1],list2[1],list3[1]]
	vlist3 = [list1[2],list2[2],list3[2]]
	xlist1 = [list1[0],list2[1],list3[2]]
	xlist2 = [list1[2],list2[1],list3[0]]
	if list1 == correct:
		answer = "yes"
		break
	elif list2 == correct:
		answer = "yes"
		break
	elif list3 == correct:
		answer = "yes"
		break
	elif vlist1 == correct:
		answer = "yes"
		break
	elif vlist2 == correct:
		answer = "yes"
		break
	elif vlist3 == correct:
		answer = "yes"
		break
	elif xlist1 == correct:
		answer = "yes"
		break
	elif xlist2 == correct:
		answer = "yes"
		break
print(answer)

list1 = input().split(" ")
list2 = input().split(" ")
list3 = input().split(" ")
count = int(input())
correct = ['o','o','o']
answer = "No"
for i in range(count):
	num = input()
	list1 = ['o' if i == num else i for i in list1]
	list2 = ['o' if i == num else i for i in list2]
	list3 = ['o' if i == num else i for i in list3]
	vlist1 = [list1[0],list2[0],list3[0]]
	vlist2 = [list1[1],list2[1],list3[1]]
	vlist3 = [list1[2],list2[2],list3[2]]
	xlist1 = [list1[0],list2[1],list3[2]]
	xlist2 = [list1[2],list2[1],list3[0]]
	if list1 == correct:
		answer = "Yes"
		break
	elif list2 == correct:
		answer = "Yes"
		break
	elif list3 == correct:
		answer = "Yes"
		break
	elif vlist1 == correct:
		answer = "Yes"
		break
	elif vlist2 == correct:
		answer = "Yes"
		break
	elif vlist3 == correct:
		answer = "Yes"
		break
	elif xlist1 == correct:
		answer = "Yes"
		break
	elif xlist2 == correct:
		answer = "Yes"
		break    
print(answer)

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=[[0]*3 for i in range(3)]
b=[]
for i in range(3):
  x=input().split()
  a[i][0]=x[0]
  a[i][1]=x[1]
  a[i][2]=x[2]
n=int(input())
for i in range(n):
  b.append(input())
for i in range(n):
  for j in range(9):
    if b[i]==a[j//3][j%3]:
      a[j//3][j%3]='X'
jud=[0,0,0,0]
z=0
res=0
for i in range(3):
  for j in range(2):
    if a[i][j]==a[i][j+1]:
      jud[0]+=1
    if a[j][i]==a[j+1][i]:
      jud[1]+=1
  if max(jud)>1:
    res-=1
  else:
    jud[0]=0
    jud[1]=0
for j in range(2):
  if a[j][j]==a[j+1][j+1]:
    jud[2]+=1
  if a[j][2-j]==a[j+1][2-j-1]:
    jud[3]+=1
  if max(jud)>1:
    res-=1
  else:
    jud[3]=0
    jud[2]=0
if res<0:
  print('Yes')
else:
  print('No')

a=[[0]*3 for i in range(3)]
b=[]
for i in range(3):
  x=input().split()
  a[i][0]=x[0]
  a[i][1]=x[1]
  a[i][2]=x[2]
n=int(input())
for i in range(n):
  b.append(input())
for i in range(n):
  for j in range(9):
    if b[i]==a[j//3][j%3]:
      a[j//3][j%3]='X'
jud=[0,0,0,0]
z=0
res=0
for i in range(3):
  for j in range(2):
    if a[i][j]==a[i][j+1]:
      jud[0]+=1
    if a[j][i]==a[j+1][i]:
      jud[1]+=1
  if max(jud)>1:
    res-=1
  else:
    jud[0]=0
    jud[1]=0
for j in range(2):
  if a[j][j]==a[j+1][j+1]:
    jud[2]+=1
  if a[j][2-j]==a[j+1][2-j-1]:
    jud[3]+=1
if max(jud)>1:
  res-=1
if res<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):
import sys
a =[]
a.append(list(map(int,input().split())))
a.append(list(map(int,input().split())))
a.append(list(map(int,input().split())))
n = int(input())
b =[]
for i in range(n):
    b.append(int(input()))
#print(b)
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = 0

import sys
a =[]
a.append(list(map(int,input().split())))
a.append(list(map(int,input().split())))
a.append(list(map(int,input().split())))
n = int(input())
b =[]
for i in range(n):
    b.append(int(input()))
#print(b)
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = 0
#print(a)

for i in range(3):
    if sum(a[i])==0:
        print('Yes')
        exit()
for i in range(3):
    if a[0][i]+a[1][i]+a[2][i]==0:
        print('Yes')
        exit()
if (a[0][0]+a[1][1]+a[2][2]==0)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):
a1,a2,a3,_,*b = [i.split() for i in open(0)]
bingo = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [2, 5, 8], [0, 3, 6], [1, 4, 7], [0, 4, 8], [2, 4, 6]]
s = ["" if i in b else i for i in a1 + a2 + a3]
for i,j,k in bingo:
    if {s[i],s[j],s[k]} ==  {''}:
        print('Yes')
        exit()
print('No')

a1,a2,a3,_,*b = [i.split() for i in open(0)]
bingo = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [2, 5, 8], [0, 3, 6], [1, 4, 7], [0, 4, 8], [2, 4, 6]]
s = ["" if i in sum(b,[]) else i for i in a1 + a2 + a3]
for i,j,k in bingo:
    if {s[i],s[j],s[k]} ==  {''}:
        print('Yes')
        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):
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 k in range(N):
    print(B[k][0])
    for i in range(3):
        for j in range(3):
            print(A[i][j])
            if B[k][0] == A[i][j]:
                A[i][j] = 0

if A[0][0] == A[0][1] == A[0][2] ==0:
    print("Yes")
elif A[1][0] == A[1][1] == A[1][2] ==0:
    print("Yes")
elif A[2][0] == A[2][1] == A[2][2] ==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[2][2] == A[1][1] == A[2][0] ==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 k in range(N):
    for i in range(3):
        for j in range(3):
            if B[k][0] == A[i][j]:
                A[i][j] = 0

if A[0][0] == A[0][1] == A[0][2] ==0:
    print("Yes")
elif A[1][0] == A[1][1] == A[1][2] ==0:
    print("Yes")
elif A[2][0] == A[2][1] == A[2][2] ==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: 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 cal(lst1, lst2, lst3):
    for i in range(3):
        if lst1[i] in lst3:
            lst2[i] = 1

def judge(a, b, c):
    if a == 1 and (a == b == c):
        return True
    else:
        return False

A_1 = list(map(int, input().split()))
A_2 = list(map(int, input().split()))
A_3 = list(map(int, input().split()))
N = int(input())
b = [int(input()) for _ in range(N)]
C_1 = [0, 0, 0]
C_2 = [0, 0, 0]
C_3 = [0, 0, 0]
cal(A_1, C_1, b)
cal(A_2, C_2, b)
cal(A_3, C_3, b)

a, b, c, d, e, f, g, h = False

a = judge(C_1[0], C_2[0], C_3[0])
b = judge(C_1[1], C_2[1], C_3[1])
c = judge(C_1[2], C_2[2], C_3[2])


d = judge(C_1[0], C_1[1], C_1[2])
e = judge(C_2[0], C_2[1], C_2[2])
f = judge(C_3[0], C_3[1], C_3[2])

g = judge(C_1[0], C_2[1], C_3[2])
h = judge(C_1[2], C_2[1], C_3[0])

lst = [a, b, c, d, e, f, g]

if True in lst:
    print('Yes')
else:
    print('No')

def cal(lst1, lst2):
    lst3 = [0, 0, 0]
    for i in range(3):
        if lst1[i] in lst2:
            lst3[i] = 1
    return lst3

def judge(a, b, c):
    if (a == 1) and (a == b == c):
        return True
    else:
        return False

A_1 = list(map(int, input().split()))
A_2 = list(map(int, input().split()))
A_3 = list(map(int, input().split()))
N = int(input())
b = [int(input()) for _ in range(N)]

C_1 = []
C_2 = []
C_3 = []

C_1 = cal(A_1, b)
C_2 = cal(A_2, b)
C_3 = cal(A_3, b)

a = judge(C_1[0], C_2[0], C_3[0])
b = judge(C_1[1], C_2[1], C_3[1])
c = judge(C_1[2], C_2[2], C_3[2])

d = judge(C_1[0], C_1[1], C_1[2])
e = judge(C_2[0], C_2[1], C_2[2])
f = judge(C_3[0], C_3[1], C_3[2])

g = judge(C_1[0], C_2[1], C_3[2])
h = judge(C_1[2], C_2[1], C_3[0])

lst = [a, b, c, d, e, f, g, h]

if True in lst:
    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):

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

b1 = [0,0,0]
b2 = [0,0,0]
b3 = [0,0,0]

for i in range(n):
    b = int(input())
    for j in range(3):
        if a1[j] == b:
            b1[j] = 1
        if a2[j] == b:
            b2[j] = 1
        if a3[j] == b:
            b3[j] = 1

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



a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
n = int(input())
b = [int(input()) for _ in range(n)]

b1 = [0] * 3
b2 = [0] * 3
b3 = [0] * 3

for i in b:
    for j in range(3):
        if i == a1[j]:
            b1[j] = 1
for i in b:
    for j in range(3):
        if i == a2[j]:
            b2[j] = 1
for i in b:
    for j in range(3):
        if i == a3[j]:
            b3[j] = 1

print(b1)
print(b2)
print(b3)


if b1[0] == b2[0] == b3[0] ==1 or b1[1] == b2[1] == b3[1] == 1 or b1[2] == b2[2] == b3[2]==1:
    print("Yes")
    exit()
elif b1[0] == b2[1] == b3[2] == 1 or b1[2] == b2[1] == b3[0] ==1:
    print("Yes")
    exit()
elif b1[0] == b1[1] == b1[2] == 1 or b2[0] == b2[1] == b2[2] == 1 or b3[0] == b3[1] == b3[2] == 1:
    print("Yes")
    exit()

print("No")



A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
n = int(input())
b = [int(input()) for _ in range(n)]
B1 = [0,0,0] 
B2 = [0,0,0]
B3 = [0,0,0]

for i in b:
    if i in A1:
        x = A1.index(i)
        B1[x] = 1
    if i in A2:
        x = A2.index(i)
        B2[x] = 1
    if i in A3:
        x = A3.index(i)
        B3[x] = 1

if B1[0] == B1[1] == B1[2] == 1 or B2[0] == B2[1] == B2[2] == 1 or B3[0] == B3[1] == B3[2] == 1:
    print("Yes")
    exit()
elif B1[0] == B2[0] == B3[0] == 1 or B1[1] == B2[1] == B3[1] == 1 or B1[2] == B2[2] == B3[2] == 1 or B1[0] == B2[1] == B3[2] == 1 or B1[2] == B2[1] == B3[0] == 1:
    print("Yes")
    exit()
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):
def resolve():
    a_list = list(map(int,input().split()))
    b_list = list(map(int,input().split()))
    c_list = list(map(int,input().split()))
    arr = np.array([a_list, b_list, c_list])

    n = int(input())
    for _ in range(n):
        num = int(input())
        arr = np.where(arr == num, 0, arr)

    if True in np.all(arr == 0, axis=0):
        print('Yes')
        return

    elif True in np.all(arr == 0, axis=1):
        print('Yes')
        return

    elif arr[0, 0] == 0 and arr[1, 1] == 0 and arr[2, 2] == 0:
        print('Yes')
        return

    elif arr[2, 0] == 0 and arr[1, 1] == 0 and arr[0, 2] == 0:
        print('Yes')
        return

    else:
        print('No')
        return
      
resolve()

import numpy as np


def resolve():
    a_list = list(map(int,input().split()))
    b_list = list(map(int,input().split()))
    c_list = list(map(int,input().split()))
    arr = np.array([a_list, b_list, c_list])

    n = int(input())
    for _ in range(n):
        num = int(input())
        arr = np.where(arr == num, 0, arr)

    if True in np.all(arr == 0, axis=0):
        print('Yes')
        return

    elif True in np.all(arr == 0, axis=1):
        print('Yes')
        return

    elif arr[0, 0] == 0 and arr[1, 1] == 0 and arr[2, 2] == 0:
        print('Yes')
        return

    elif arr[2, 0] == 0 and arr[1, 1] == 0 and arr[0, 2] == 0:
        print('Yes')
        return

    else:
        print('No')
        return
      
resolve()

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)]
appear = [[False] * 3] * 3
print("appear", appear)
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                appear[j][k] = True

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


a = [[int(i) for i in input().split()] for _ in range(3)]
appear = [[False] * 3] * 3
print("appear", appear)
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                appear[j][k] = True

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


a = [[int(i) for i in 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

Wrong Answer

Accepted