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):
import sys

def solve():
    input=sys.stdin.readline
    mod=10*9+7
    a=[list(map(int,input().rstrip("\n").split())) for _ in range(3)]
    n= int(input().rstrip("\n"))
    for _ in range(n):
        b= int(input().rstrip("\n"))
        for i in range(3):
            for j in range(3):
                if a[i][j]==b:
                    a[i][j]=-1
    
    for i in range(3):
        if a[i][0]==a[i][1]==a[i][2]==-1:
            print("Yes")
        elif a[0][i]==a[1][i]==a[2][i]==-1:
            print("Yes")
    if a[0][0]==a[1][1]==a[2][2]==-1:
        print("Yes")
        exit()
    elif a[0][2]==a[1][1]==a[2][0]==-1:
        print("Yes")
        exit()
    print("No")

A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
B=[int(input()) for _ in range(N)]
for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            A[i][j]=-1

is_bingo=False

for i in range(3):
    if A[i][0]==A[i][1]==A[i][2]==-1:
        is_bingo=True
        break

for i in range(3):
    if A[0][i]==A[1][i]==A[2][i]==-1:
        is_bingo=True
        break

if A[0][0]==A[1][1]==A[2][2]==-1 or A[2][0]==A[1][1]==A[0][2]==-1:
    is_bingo=True

print("Yes" if is_bingo==True 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):
41 7 46
26 89 2
78 92 8
5
6
45
16
57
17


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

n = int(input())
for _ in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if bingo[i][j] == b:
                bingo[i][j] = "o"

for i in range(3):
    flag = 0
    for j in range(3):
        if bingo[i][j] == "o":
            flag += 1
    if flag == 3:
        print("Yes")
        exit()
    flag = 0
    for j in range(3):
        if bingo[j][i] == "o":
            flag += 1
    if flag == 3:
        print("Yes")
        exit()

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


Verdicts: Runtime Error

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

Submission attempts (in order):
import sys

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

N = int(input())
numbers = set()
for i in range(N):
    numbers.add(int(input()))


def checker(s):
    if len(s) == 1 and 'x' in s:
        print('YES')
        sys.exit()


for i in range(3):
    for j in range(3):
        if card[i][j] in numbers:
            card[i][j] = 'x'

# checks to see if the rows
for row in card:
    s = set()
    for col in row:
        s.add(col)
    checker(s)

# checks to see if the columns
for i in range(3):
    for j in range(3):
        s = set()
        s.add(card[j][i])
        checker(s)
# diagonals
s = set()
for i in range(3):
    s.add(card[i][i])
checker(s)

for i in range(2, -1, -1):
    s.add(card[i][i])
checker(s)

print('NO')


import sys

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

N = int(input())
numbers = set()
for i in range(N):
    numbers.add(int(input()))


def checker(aa):
    if len(aa) == 1 and 'x' in aa:
        print('Yes')
        sys.exit()


for i in range(3):
    for j in range(3):
        if card[i][j] in numbers:
            card[i][j] = 'x'

# checks to see if the rows
for row in card:
    s = set()
    for col in row:
        s.add(col)
    checker(s)

# checks to see if the columns
for i in range(3):
    s = set()
    for j in range(3):
        s.add(card[j][i])
    checker(s)
# diagonals
s = set()
for i in range(3):
    s.add(card[i][i])
checker(s)

a = set()
a.add(card[0][2])
a.add(card[1][1])
a.add(card[2][0])
checker(a)


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()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
N = int(input())
numbers = list()
for i in range(N):
    numbers.append(int(input()))

bingo = False
for a in A:
    if a not in numbers:
        break
else:
    bingo = True

for b in B:
    if b not in numbers:
        break
else:
    bingo = True

for c in C:
    if c not in numbers:
        break
else:
    bingo = True

columnA = [A[0],B[0],C[0]]
for i in columnA:
    if i not in numbers:
        break
else:
    bingo = True

columnB = [A[1],B[1],C[1]]
for i in columnB:
    if i not in numbers:
        break
else:
    bingo = True

columnC = [A[2],B[2],C[2]]
for i in columnB:
    if i not in numbers:
        break
else:
    bingo = True

diagA = [A[0],B[1],C[2]]
for i in diagA:
    if i not in numbers:
        break
else:
    bingo = True

diagB = [A[3],B[2],C[1]]
for i in diagB:
    if i not in numbers:
        break
else:
    bingo = True

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

A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
N = int(input())
numbers = list()
for i in range(N):
    numbers.append(int(input()))

bingo = False
for a in A:
    if a not in numbers:
        break
else:
    bingo = True

for b in B:
    if b not in numbers:
        break
else:
    bingo = True

for c in C:
    if c not in numbers:
        break
else:
    bingo = True

columnA = [A[0],B[0],C[0]]
for i in columnA:
    if i not in numbers:
        break
else:
    bingo = True

columnB = [A[1],B[1],C[1]]
for i in columnB:
    if i not in numbers:
        break
else:
    bingo = True

columnC = [A[2],B[2],C[2]]
for i in columnC:
    if i not in numbers:
        break
else:
    bingo = True

diagA = [A[0],B[1],C[2]]
for i in diagA:
    if i not in numbers:
        break
else:
    bingo = True

diagB = [A[2],B[1],C[0]]
for i in diagB:
    if i not in numbers:
        break
else:
    bingo = True

print("Yes" if bingo 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):
a1=input("").split(" ")
a2=input("").split(" ")
a3=input("").split(" ")
lista=[]
listmp=[]
for k in range(3):
    listmp+=[int(a1[i])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a2[i])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a3[i])]
lista+=[listmp]
n=int(input(""))
listn=[]
for i in range(n):
    t=int(input(""))
    listn+=[t]
for i in range(3):
    for k in range(3):
        if(lista[i][k] in listn):
            lista[i][k]=0
p=0
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[i][k]

        if(s==0):
            p=1
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[k][i]

        if(s==0):
            p=1
s=0
for i in range(3):
    s+=lista[i][i]
if(s==0):
    p=1
s=0
for i in range(3):
    s+=lista[i][2-i]
if(s==0):
    p=1
if(p==1):
    print("Yes")
else:
    print("No")
    
    

    

a1=input("").split(" ")
a2=input("").split(" ")
a3=input("").split(" ")
lista=[]
listmp=[]
for k in range(3):
    listmp+=[int(a1[k])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a2[k])]
lista+=[listmp]
listmp=[]
for k in range(3):
    listmp+=[int(a3[k])]
lista+=[listmp]
n=int(input(""))
listn=[]
for i in range(n):
    t=int(input(""))
    listn+=[t]
for i in range(3):
    for k in range(3):
        if(lista[i][k] in listn):
            lista[i][k]=0
p=0
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[i][k]

    if(s==0):
            p=1
for i in range(3):
    s=0
    for k in range(3):
        s+=lista[k][i]

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


A=list(map(int,input().spliy()))
B=list(map(int,input().spliy()))
C=list(map(int,input().spliy()))
n=input()
for i range(n):
  D[i]=int(input())

Acount=0 
Bcount=0
Ccount=0
  
for i in range(0,n):
  if A[0]==D[i]:
    Acount+=1
  if A[1]==D[i]:
    Acount+=1
  if A[2]==D[i]:
    Acount+=1
  if(Acpunt)==3:
    exit()
for i in range(0,n):
  if B[0]==D[i]:
    Bcount+=1
  if B[1]==D[i]:
    Bcount+=1
  if B[2]==D[i]:
    Bcount+=1
  if(Bcpunt)==3:
    exit()
for i in range(0,n):
  if C[0]==D[i]:
    Ccount+=1
  if C[1]==D[i]:
    Ccount+=1
  if C[2]==D[i]:
    Ccount+=1
  if(Ccpunt)==3:
    exit()

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

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


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


Verdicts: Runtime Error

Runtime Error

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

ans = 'No'
for i, row in enumerate(A):
    for j, value in enumerate(row):
        if value in b:
            B[i][j] = 1
print(B)
if B[0][0]==B[0][1]==B[0][2]==1 or B[1][0]==B[1][1]==B[1][2]==1 or B[2][0]==B[2][1]==B[2][2]==1:
    ans = 'Yes'
elif B[0][0]==B[1][0]==B[2][0]==1 or B[0][1]==B[1][1]==B[2][1]==1 or B[0][2]==B[1][2]==B[2][2]==1:
    ans = 'Yes'
elif B[0][0]==B[1][1]==B[2][2]==1 or B[0][2]==B[1][1]==B[2][0]==1:
    ans = 'Yes'
print(ans)

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

ans = 'No'
for i, row in enumerate(A):
    for j, value in enumerate(row):
        if value in b:
            B[i][j] = 1

if aB[0][0]==B[0][1]==B[0][2]==1 or B[1][0]==B[1][1]==B[1][2]==1 or B[2][0]==B[2][1]==B[2][2]==1:
    ans = 'Yes'
elif B[0][0]==B[1][0]==B[2][0]==1 or B[0][1]==B[1][1]==B[2][1]==1 or B[0][2]==B[1][2]==B[2][2]==1:
    ans = 'Yes'
elif B[0][0]==B[1][1]==B[2][2]==1 or B[2][2]==B[1][1]==B[2][0]==1:
    ans = 'Yes'
print(ans)

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

ans = 'No'
for i, row in enumerate(A):
    for j, value in enumerate(row):
        if value in b:
            B[i][j] = 1

if B[0][0]==B[0][1]==B[0][2]==1 or B[1][0]==B[1][1]==B[1][2]==1 or B[2][0]==B[2][1]==B[2][2]==1:
    ans = 'Yes'
elif B[0][0]==B[1][0]==B[2][0]==1 or B[0][1]==B[1][1]==B[2][1]==1 or B[0][2]==B[1][2]==B[2][2]==1:
    ans = 'Yes'
elif B[0][0]==B[1][1]==B[2][2]==1 or B[0][2]==B[1][1]==B[2][0]==1:
    ans = 'Yes'
print(ans)

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


for _ in range(N):
    B = int(input())
    for i in range(3):
      for j in range(3):
          if A[i][j] == B:
              A[i][j] == 0
        
bingo = False
for row in A:
  if sum(row) == 0:
    bingo = True
for col in zip(*A):
  if sum(col) == 0:
    bingo= True
if sum(A[i][i] for i in range(3) )== 0:
  bingo =True
if sum(A[i][3 - i - 1] for i in range(3)) == 0:
  bingo = True
  
print("Yes" if bingo == True else "No")

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


for _ in range(N):
    B = int(input())
    for i in range(3):
      for j in range(3):
          if A[i][j] == B:
              A[i][j] = 0
        
bingo = False
for row in A:
  if sum(row) == 0:
    bingo = True
for col in zip(*A):
  if sum(col) == 0:
    bingo = True
if sum(A[i][i] for i in range(3)) == 0:
  bingo =True
if sum(A[i][3 - i - 1] for i in range(3)) == 0:
  bingo = True
  
print("Yes" if bingo == True 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 = []
for i in range(0, 3):
  a = input().split(' ')
  for j in a:
    A.append(int(j))

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

for i in range(0, N):
  data = int(input())
  if data in A:
    A[A.index(data)] = 0


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

A = []
for i in range(0, 3):
  a = input().split(' ')
  for j in a:
    A.append(int(j))

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

for i in range(0, N):
  data = int(input())
  if data in A:
    A[A.index(data)] = 0

if sum(A[0:3]) == 0 \
or sum(A[3:6]) == 0 \
or sum(A[6:9]) == 0 \
or A[0] + A[4] + A[8] == 0 \
or A[2] + A[4] + A[6] == 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: 
  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 = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]

for i in range(3):
  for j in range(3):
    if a[i][j] in b:
      a[i][j] == 0
print("Yes" if any(i.count(0) == 3 for i in a) or any(i.count(0) == 3 for i in zip(*a)) else "No")



a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [i 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
print("Yes" if any(i.count(0) == 3 for i in a))
print("Yes" if any(i.count(0) == 3 for i in zip(*a)))


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

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

c = [[a[0][0], a[1][1], a[2][2]], [a[0][2], a[1][1], a[2][0]]]

print("Yes" if any(i.count(0) == 3 for i in a) or any(i.count(0) == 3 or any(i.count(0) == 3 for i in c) for i in zip(*a)) else "No")



s = " 012 345 678 036 147 258 048 246 "
a = [input().split() for i in range(3)]
b = a[0] + a[1] + a[2]

for i in [input()for i in range(int(input()))]:
  if i in b:
    s = s.replace(str(b.index(i)), "")
print("Yes" if "  " in s else "No")

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
n,m=map(int,input().split())
# a,b,c=map(int,input().split())
# s=input()
# s,t=map(str,input().split())
ans=[0]*n
anss=""
l=[]
L=[]
for i in range(m):
  s,c=map(int,input().split())
  l.append(str(s)+str(c))
  if s==1 and c==0:
    print(-1)
    exit()

l=list(set(l))
for x in l:
  L.append([x[0],x[1]])
X=[]

for i in range(len(L)):

  ans[int(L[i][0])-1] = int(L[i][1])
  if L[i][0] in X:
    print(-1)
    exit()
  else:
      X.append(L[i][0])
print(ans)
if ans[0]==0:
  if n!=1:
    ans[0]="1"
    for x in ans:
      anss+=str(x)
      print(anss)
  else:
    print(0)
else:
  for x in ans:
    anss+=str(x)
  print(anss)


# n,m=map(int,input().split())
# a,b,c=map(int,input().split())
# s=input()
# s,t=map(str,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
L=[]
L.append(A)
L.append(B)
L.append(C)
n=int(input())

for i in range(n):
  x=int(input())
  for a in range(3):
    for b in range(3):
      if L[a][b] == x:
        L[a][b]=0

if L[0][0]==0 and L[0][1]==0 and L[0][2]==0:
  print("Yes")
  exit()

if L[1][0]==0 and L[1][1]==0 and L[1][2]==0:
  print("Yes")
  exit()

if L[2][0]==0 and L[2][1]==0 and L[2][2]==0:
  print("Yes")
  exit()

if L[0][0]==0 and L[1][0]==0 and L[2][0]==0:
  print("Yes")
  exit()
if L[0][1]==0 and L[1][1]==0 and L[2][1]==0:
  print("Yes")
  exit()
if L[0][2]==0 and L[1][2]==0 and L[2][2]==0:
  print("Yes")
  exit() 
if L[0][0]==0 and L[1][1]==0 and L[2][2]==0:
  print("Yes")
  exit()
if L[0][2]==0 and L[1][1]==0 and L[2][0]==0:
  print("Yes")
  exit()


print("No")
    
    

Verdicts: Runtime Error

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

Submission attempts (in order):
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]



for i in range(3):
    for j in range(3):
        if (A[i][j] in B):
            A[i][j] = True
        else:
            A[i][j] = False

print(A)

for i in range(3):
    if A[i][0] and A[i][1] and A[i][2]:
        print("Yes")
        exit()

    if A[0][i] and A[1][i] and A[2][i]:
        print("Yes")
        exit()

if A[0][0] and A[1][1]and A[2][2]:
    print("Yes")
    exit()

if A[2][0] and A[1][1] and A[0][2]:
    print("Yes")
    exit()

print("No")


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



isBingo = False


for i in range(2):
    for j in range(2):
        if (A[i][j] in B):
            A[i][j] = True
        else:
            A[i][j] = False

cnt = 0


for i in range(2):
    for j in range(2):
        if (A[i][j]):
            cnt += 1
    if (cnt == 2):
        print("retu")
        print("yes")
        exit()
    cnt = 0


for j in range(2):
    for i in range(2):
        if (A[i][j]):
            cnt += 1
    if (cnt == 2):
        print("gyo")
        print("yes")
        exit()
    cnt = 0


for i in range(2):
    if (A[i][j]):
        cnt += 1
    if (cnt == 2):
        print("naname")
        print("yes")
        exit()
    cnt = 0


if (A[0][2] and A[1][1] and A[2][0]):
    print("migiue")
    print("yes")
    exit()


print("no")


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



for i in range(3):
    for j in range(3):
        if (A[i][j] in B):
            A[i][j] = True
        else:
            A[i][j] = False


for i in range(3):
    if A[i][0] and A[i][1] and A[i][2]:
        print("Yes")
        exit()

    if A[0][i] and A[1][i] and A[2][i]:
        print("Yes")
        exit()

if A[0][0] and A[1][1]and A[2][2]:
    print("Yes")
    exit()

if A[2][0] and A[1][1] and A[0][2]:
    print("Yes")
    exit()

print("No")


Verdicts: Wrong Answer

Wrong Answer

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

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


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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
import numpy as np

A1=np.array(list(map(int,input().split())))
A2=np.array(list(map(int,input().split())))
A3=np.array(list(map(int,input().split())))
A=np.concatenate([A1,A2,A3]).reshape(3,3)

N=int(input())

for i in range(N):
    b=int(input())
    A[np.where(A==b)] = 0

if np.all(A[0,:]==0) or np.all(A[1,:]==0) or np.all(A[2,:]==0) or np.all(A[:,0]==0) or np.all(A[:,1]==0) 
\or np.all(A[:,2]==0) or A[0,0]**2+A[1,1]**2+A[2,2]**2==0:
    print('Yes')
else:
    print('No')

import numpy as np

A1=np.array(list(map(int,input().split())))
A2=np.array(list(map(int,input().split())))
A3=np.array(list(map(int,input().split())))
A=np.concatenate([A1,A2,A3]).reshape(3,3)

N=int(input())

for i in range(N):
    b=int(input())
    A[np.where(A==b)] = 0

if np.all(A[0,:]==0) or np.all(A[1,:]==0) or np.all(A[2,:]==0) or np.all(A[:,0]==0) or np.all(A[:,1]==0) \
    or np.all(A[:,2]==0) or A[0,0]**2+A[1,1]**2+A[2,2]**2==0 or A[0,2]**2+A[1,1]**2+A[2,0]**2==0:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

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

Submission attempts (in order):
A = []
out = []
for x in range(3):
    A.append(list(map(int, input().split())))
    out.append([0, 0, 0])
N = int(input())
b = []
for B in range(N):
    b.append(int(input()))
for pick in b:
    for y in range(3):
        for x in range(3):
            if pick == A[y][x]:
                out[y][x] = 1

bingo = False
for x in range(3):
    if out[x][0] == 1 and out[x][1]　== 1 and out[x][2] == 1:
        bingo = True

for x in range(3):
    if out[0][x] == 1 and out[1][x] == 1 and out[2][x] == 1:
        bingo = True

for x in range(3):
    if out[0][0] == 1 and out[1][1] == 1 and out[2][2] == 1:
        bingo = True

    if out[2][0] == 1 and out[1][1] == 1 and out[2][0] == 1:
        bingo = True

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


A = []
out = []
for x in range(3):
    A.append(list(map(int, input().split())))
    out.append([0, 0, 0])
N = int(input())
b = []
for B in range(N):
    b.append(int(input()))
for pick in b:
    for y in range(3):
        for x in range(3):
            if pick == A[y][x]:
                out[y][x] = 1

bingo = False
for x in range(3):
    if out[x][0] == 1 and out[x][1] == 1 and out[x][2] == 1:
        bingo = True

for x in range(3):
    if out[0][x] == 1 and out[1][x] == 1 and out[2][x] == 1:
        bingo = True

for x in range(3):
    if out[0][0] == 1 and out[1][1] == 1 and out[2][2] == 1:
        bingo = True

    if out[2][0] == 1 and out[1][1] == 1 and out[2][0] == 1:
        bingo = True

if bingo:
    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 sys
a1 = list(map(str,input().split()))
a2 = list(map(str,input().split()))
a3 = list(map(str,input().split()))
M=int(input())
N = "N"
if M <= 2:
    print('No')
    sys.exit()

Num=[] 
while True:
    try:
        Num.append(input())

    except:
        break;

A1= ["N" if Num.count(i)!=0 else i for i in a1]
A2= ["N" if Num.count(i)!=0 else i for i in a2]
A3= ["N" if Num.count(i)!=0 else i for i in a3]
print(A1,A2,A3,Num)
if A1[0] == N and A1[1] == N and A1[2] == N :
    print("Yes")
elif A2[0] == N and A2[1] == N and A2[2] == N :
    print("Yes")
elif A3[0] == N and A3[1] == N and A3[2] == N :
    print("Yes")
elif A1[0] == N and A2[0] == N and A3[0] == N :
    print("Yes")
elif A1[1] == N and A2[1] == N and A3[2] == N :
    print("Yes")
elif A1[2] == N and A2[2] == N and A3[2] == N :
    print("Yes")
elif A1[0] == N and A2[1] == N and A3[2] == N :
    print("Yes")
elif A1[2] == N and A2[1] == N and A3[0] == N :
    print("Yes")
else:
    print("No")



import sys
a1 = list(map(str,input().split()))
a2 = list(map(str,input().split()))
a3 = list(map(str,input().split()))
M=int(input())
N = "N"
if M <= 2:
    print('No')
    sys.exit()

Num=[] 
while True:
    try:
        Num.append(input())

    except:
        break;

A1= ["N" if Num.count(i)!=0 else i for i in a1]
A2= ["N" if Num.count(i)!=0 else i for i in a2]
A3= ["N" if Num.count(i)!=0 else i for i in a3]

if A1[0] == N and A1[1] == N and A1[2] == N :
    print("Yes")
elif A2[0] == N and A2[1] == N and A2[2] == N :
    print("Yes")
elif A3[0] == N and A3[1] == N and A3[2] == N :
    print("Yes")
elif A1[0] == N and A2[0] == N and A3[0] == N :
    print("Yes")
elif A1[1] == N and A2[1] == N and A3[2] == N :
    print("Yes")
elif A1[2] == N and A2[2] == N and A3[2] == N :
    print("Yes")
elif A1[0] == N and A2[1] == N and A3[2] == N :
    print("Yes")
elif A1[2] == N and A2[1] == N and A3[0] == N :
    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):
#B
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    m = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == m:
                a[j][k] = 0
f = False
print(a)
for j in range(3):
    if a[j][0] == 0 and a[j][1] == 0 and a[j][2] == 0:
        f = True
    if a[0][j] == 0 and a[1][j] == 0 and a[2][j] == 0:
        f = True
if (a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0) or (a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0):
    f = True
if f:
    print('Yes')
else:
    print('No')

#B
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for i in range(n):
    m = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == m:
                a[j][k] = 0
f = False
for j in range(3):
    if a[j][0] == 0 and a[j][1] == 0 and a[j][2] == 0:
        f = True
    if a[0][j] == 0 and a[1][j] == 0 and a[2][j] == 0:
        f = True
if (a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0) or (a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0):
    f = True
if f:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

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

Submission attempts (in order):
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())

lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = []
for(i in range(int(input()))):
  nums.append(input())
flag = false

n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")

n11, n12, n13 = int(input().split())
n21, n22, n23 = int(input().split())
n31, n32, n33 = int(input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = []
for(i in range(int(input()))):
  nums.append(input())
flag = false
for(l in lines):
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")
    


n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[int(input())] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

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):
li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
li3 = list(map(int,input().split()))
N = int(input())
b = [int(input()) for i in range(N)]
A = li1+li2+li3

hit = []
for i in b:
    if i in A:
        hit.append(A.index(i)+1)

if (1 in hit and 2 in hit and 3 in hit)\
or (4 in hit and 5 in hit and 6 in hit)\
or (7 in hit and 8 in hit and 9 in hit)\
or (1 in hit and 4 in hit and 7 in hit)\
or (2 in hit and 5 in hit and 8 in hit)\
or (3 in hit and 6 in hit and 9 in hit)\
or (1 in hit and 5 in hit and 9 in hit)\
or (3 in hit and 5 in hit and 7 in hit):
    print("Tes")
else:
    print("No")

li1 = list(map(int,input().split()))
li2 = list(map(int,input().split()))
li3 = list(map(int,input().split()))
N = int(input())
b = [int(input()) for i in range(N)]
A = li1+li2+li3

hit = []
for i in b:
    if i in A:
        hit.append(A.index(i)+1)

if (1 in hit and 2 in hit and 3 in hit)\
or (4 in hit and 5 in hit and 6 in hit)\
or (7 in hit and 8 in hit and 9 in hit)\
or (1 in hit and 4 in hit and 7 in hit)\
or (2 in hit and 5 in hit and 8 in hit)\
or (3 in hit and 6 in hit and 9 in hit)\
or (1 in hit and 5 in hit and 9 in hit)\
or (3 in hit and 5 in hit and 7 in hit):
    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 main():
    A = []
    for _ in range(3):
        a = map(int,input().split())
        A += a
    N = int(input())
    B = [int(input()) for _ in range(N)]
    for i in range(N):
        for j in range(9):
            if A[j] == B[i]:
                A[j] = -1
    ans = False
    
    for i in range(3):
        if A[i] == -1 and A[i + 3] == -1 and A[i + 6] == -1 :
            ans = True
    
    for i in range(3):
        if A[i] == - 1 and A[i + 1] == -1 and A[i +2] == -1 :
            ans = True
    
    for i in range(2,4):
        if A[4] == -1 and A[4 - i] == -1 and A[4 + i] == -1 :
            ans = True
    if ans :
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

def main():
    A = []
    for _ in range(3):
        a = map(int,input().split())
        A += a
    N = int(input())
    B = [int(input()) for _ in range(N)]
    for i in range(N):
        for j in range(9):
            if A[j] == B[i]:
                A[j] = -1
    ans = False
    
    for i in range(3):
        if A[i] == -1 and A[i + 3] == -1 and A[i + 6] == -1 :
            ans = True
    
    for i in range(3):
        if A[3 * i] == - 1 and A[3 * i + 1] == -1 and A[3 * i +2] == -1 :
            ans = True
    
    for i in range(2,4):
        if A[4] == -1 and A[4 - i] == -1 and A[4 + i] == -1 :
            ans = True
    if ans :
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

def main():
    A = []
    for _ in range(3):
        a = map(int,input().split())
        A += a
    N = int(input())
    B = [int(input()) for _ in range(N)]
    for i in range(N):
        for j in range(9):
            if A[j] == B[i]:
                A[j] = -1
    ans = False
    
    for i in range(3):
        if A[i] == -1 and A[i + 3] == -1 and A[i + 6] == -1 :
            ans = True
    
    for i in range(3):
        if A[3 * i] == - 1 and A[3 * i + 1] == -1 and A[3 * i + 2] == -1 :
            ans = True
    
    for i in [2, 4]:
        if A[4] == -1 and A[4 - i] == -1 and A[4 + i] == -1 :
            ans = True
    if ans :
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

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):
# coding: utf-8
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = list([int(input()) for _ in range(n)])
ans = "No"


for bi in b:
    print(bi)
    for i in range(3):
        for j in range(3):
            if a[i][j] == bi:
                a[i][j] = "hole"

# tate bingo
for j in range(3):
    if a[0][j] == "hole":
        if a[1][j] == "hole" and a[2][j] == "hole":
            ans = "Yes"

# yoko bingo
for i in range(3):
    if a[i][0] == "hole":
        if a[i][1] == "hole" and a[i][2] == "hole":
            ans = "Yes"

# naname bingo
if a[0][0] == "hole" and a[1][1] == "hole" and a[1][1] == "hole":
    ans = "Yes"
if a[0][2] == "hole" and a[1][1] == "hole" and a[2][0] == "hole":
    ans = "Yes"

print(ans)


# coding: utf-8
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = list([int(input()) for _ in range(n)])
ans = "No"


for bi in b:
    print(bi)
    for i in range(3):
        for j in range(3):
            if a[i][j] == bi:
                a[i][j] = "hole"

# tate bingo
for j in range(3):
    if a[0][j] == "hole":
        if a[1][j] == "hole" and a[2][j] == "hole":
            ans = "Yes"

# yoko bingo
for i in range(3):
    if a[i][0] == "hole":
        if a[i][1] == "hole" and a[i][2] == "hole":
            ans = "Yes"

# naname bingo
if a[0][0] == "hole" and a[1][1] == "hole" and a[2][2] == "hole":
    ans = "Yes"
if a[0][2] == "hole" and a[1][1] == "hole" and a[2][0] == "hole":
    ans = "Yes"

print(ans)


# coding: utf-8
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = list([int(input()) for _ in range(n)])
ans = "No"


for bi in b:
    for i in range(3):
        for j in range(3):
            if a[i][j] == bi:
                a[i][j] = "hole"

# tate bingo
for j in range(3):
    if a[0][j] == "hole":
        if a[1][j] == "hole" and a[2][j] == "hole":
            ans = "Yes"

# yoko bingo
for i in range(3):
    if a[i][0] == "hole":
        if a[i][1] == "hole" and a[i][2] == "hole":
            ans = "Yes"

# naname bingo
if a[0][0] == "hole" and a[1][1] == "hole" and a[2][2] == "hole":
    ans = "Yes"
if a[0][2] == "hole" and a[1][1] == "hole" and a[2][0] == "hole":
    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):
import numpy as np

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

N = int(input());


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


A = np.hstack([A1,A2,A3]);

for i in range(N):
  for j in range(len(A)):
    if B[i] == A[j]:
      A[j] = 0;
      break;
    else:
      pass;


if A[0] == 0 and A[1] == 0 and A[2] == 0:
  print("Yes");
elif A[3] == 0 and A[4] == 0 and A[5] == 0:
  print("Yes");
elif A[6] == 0 and A[7] == 0 and A[8] == 0:
  print("Yes");
elif A[0] == 0 and A[3] == 0 and A[6] == 0:
  print("Yes");
elif A[1] == 0 and A[4] == 0 and A[7] == 0:
  print("Yes");
elif A[2] == 0 and A[5] == 0 and A[8] == 0:
  print("Yes");
elif A[0] == 0 and A[4] == 0 and A[7] == 0:
  print("Yes");
elif A[2] == 0 and A[4] == 0 and A[6] == 0:
  print("Yes");
else:
  print("No");


import numpy as np

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

N = int(input());


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


A = np.hstack([A1,A2,A3]);

for i in range(N):
  for j in range(len(A)):
    if B[i] == A[j]:
      A[j] = 0;
      break;
    else:
      pass;


if A[0] == 0 and A[1] == 0 and A[2] == 0:
  print("Yes");
elif A[3] == 0 and A[4] == 0 and A[5] == 0:
  print("Yes");
elif A[6] == 0 and A[7] == 0 and A[8] == 0:
  print("Yes");
elif A[0] == 0 and A[3] == 0 and A[6] == 0:
  print("Yes");
elif A[1] == 0 and A[4] == 0 and A[7] == 0:
  print("Yes");
elif A[2] == 0 and A[5] == 0 and A[8] == 0:
  print("Yes");
elif A[0] == 0 and A[4] == 0 and A[8] == 0:
  print("Yes");
elif A[2] == 0 and A[4] == 0 and A[6] == 0:
  print("Yes");
else:
  print("No");


Verdicts: Wrong Answer

Accepted