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):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
a = []
for i in range(n):
    b = int(input()) 
    a.append(b)
for i in range(3):
    if a1[i] in a and a2[i] in a and a3[i] in a:
        ans = 'Yes'
if a1[0] in a and a1[1] in a and a1[2] in a:
    ans = 'Yes'
if a2[0] in a and a2[1] in a and a3[2] in a:
    ans = 'Yes'
if a3[0] in a and a3[1] in a and a3[2] in a:
    ans = 'Yes'
if a1[0] in a and a2[1] in a and a3[2] in a:
    ans = 'Yes'
if a1[2] in a and a2[1] in a and a3[0] in a:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

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

A=[list(map(int,input().split())) for i in range(3)]
n=int(input())
for k in range(n):
  s=int(input())
  for i in range(3):
    for j in range(3):
      if s == A[i][j]:
        A[i][j]=0   
if A[0][0]==0 and A[1][0]==0 and A[2][0]==0:
  print("Yes")
   
elif A[0][1]==0 and A[1][1]==0 and A[2][1]==0:
  print("Yes")
elif A[0][2]==0 and A[1][2]==0 and A[2][2]==0:
  print("Yes")
elif [0,0,0] in A:
  print("Yes")
  
elif A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  print("Yes")
  
elif A[0][0]==0 and A[1][1]==0 and A[2][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):
import numpy as np

def check(a,b,c):
  return a==b==c==0


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

for i in a:
  for x in range(3):
    for y in range(3):
      if t[x][y] == i :
        t[x][y] = 0

ans = check(t[0][0],t[0][1],t[0][2]) or \
check(t[1][0],t[1][1],t[1][2]) or \
check(t[2][0],t[2][1],t[2][2]) or \
check(t[0][0],t[1][0],t[2][0]) or \
check(t[0][1],t[1][1],t[2][1]) or \
check(t[0][2],t[1][2],t[2][2]) or \
check(t[0][0],t[1][1],t[2][2]) or \
check(t[0][2],t[1][1],t[2][0]) 

print(ans)

import numpy as np

def check(a,b,c):
  return a==b==c==0


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

for i in a:
  for x in range(3):
    for y in range(3):
      if t[x][y] == i :
        t[x][y] = 0

ans = check(t[0][0],t[0][1],t[0][2]) or \
check(t[1][0],t[1][1],t[1][2]) or \
check(t[2][0],t[2][1],t[2][2]) or \
check(t[0][0],t[1][0],t[2][0]) or \
check(t[0][1],t[1][1],t[2][1]) or \
check(t[0][2],t[1][2],t[2][2]) or \
check(t[0][0],t[1][1],t[2][2]) or \
check(t[0][2],t[1][1],t[2][0]) 

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
bingo = []
sheet = set()
for _ in range(3):
  lst = [int(i) for i in input().split()]
  bingo.append(lst)
n = int(input())
for _ in range(n):
  a = int(input())
  for i in range(3):
    for j in range(3):
      if bingo[i][j] == a:
        num = 3 * i + j
        sheet.add(num)
if 0 in sheet and 1 in sheet and 2 in sheet:
  print('Yes')
if 0 in sheet and 3 in sheet and 6 in sheet:
  print('Yes')
if 0 in sheet and 4 in sheet and 8 in sheet:
  print('Yes')
if 1 in sheet and 4 in sheet and 7 in sheet:
  print('Yes')
if 2 in sheet and 5 in sheet and 8 in sheet:
  print('Yes')
if 2 in sheet and 4 in sheet and 6 in sheet:
  print('Yes')
if 3 in sheet and 4 in sheet and 5 in sheet:
  print('Yes')
if 6 in sheet and 7 in sheet and 8 in sheet:
  print('Yes')
else:
  print('No')

bingo = []
sheet = set()
for _ in range(3):
  lst = [int(i) for i in input().split()]
  bingo.append(lst)
n = int(input())
for _ in range(n):
  a = int(input())
  for i in range(3):
    for j in range(3):
      if bingo[i][j] == a:
        num = 3 * i + j
        sheet.add(num)
if 0 in sheet and 1 in sheet and 2 in sheet:
  print('Yes')
elif 0 in sheet and 3 in sheet and 6 in sheet:
  print('Yes')
elif 0 in sheet and 4 in sheet and 8 in sheet:
  print('Yes')
elif 1 in sheet and 4 in sheet and 7 in sheet:
  print('Yes')
elif 2 in sheet and 5 in sheet and 8 in sheet:
  print('Yes')
elif 2 in sheet and 4 in sheet and 6 in sheet:
  print('Yes')
elif 3 in sheet and 4 in sheet and 5 in sheet:
  print('Yes')
elif 6 in sheet and 7 in sheet and 8 in sheet:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

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

Submission attempts (in order):
for i in range(3):
    for j in a[i]:
        if j != 0:
            break
    else:
        print('Yes')
        break
    if a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0:
        print('Yes')
        break
    if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
        print('Yes')
        break
    if a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
        print('Yes')
        break
else:
    print('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

for i in range(3):
    for j in a[i]:
        if j != 0:
            break
    else:
        print('Yes')
        break
    if a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0:
        print('Yes')
        break
    if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
        print('Yes')
        break
    if a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
        print('Yes')
        break
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):
a0=list(map(int, input().split()))
a1=list(map(int, input().split()))
a2=list(map(int, input().split()))
n=int(input())
b=[]
for i in range(n):
    b.append(int(input()))
ans=[]
for i in b:
    if (i in a0) == True:
        ans.append(a0.index(i))
    if (i in a1) == True:
        ans.append((a1.index(i))+3)
    if (i in a2) == True:
        ans.append((a2.index(i))+6)
if (0 in ans) == True:
    if (1 in ans) == True:
        if (2 in ans) == True:
            print("Yes")
    elif (3 in ans) == True:
        if (6 in ans) == True:
            print("Yes")
    elif (4 in ans) == True:
        if (8 in ans) == True:
            print("Yes")
elif (1 in ans)==True:
    if  (4 in ans)==True:
        if  (7 in ans)==True:
            print("Yes")
elif (2 in ans)==True:
    if  (5 in ans)==True:
        if  (8 in ans)==True:
            print("Yes")
    elif (4 in ans)==True:
        if (6 in ans)==True:
            print("Yes")
elif (3 in ans)==True:
    if  (4 in ans)==True:
        if  (5 in ans)==True:
            print("Yes")
elif (6 in ans)==True:
    if  (7 in ans)==True:
        if  (8 in ans)==True:
            print("Yes")
else:
    print("No")


a0=list(map(int, input().split()))
a1=list(map(int, input().split()))
a2=list(map(int, input().split()))
n=int(input())
b=[]
for i in range(n):
    b.append(int(input()))
ans=[]
for i in b:
    if (i in a0) == True:
        ans.append(a0.index(i))
    if (i in a1) == True:
        ans.append((a1.index(i))+3)
    if (i in a2) == True:
        ans.append((a2.index(i))+6)
if (0 in ans) and (1 in ans) and (2 in ans) == True:
    print("Yes")
elif (0 in ans) and (3 in ans) and (6 in ans) == True:
    print("Yes")
elif (0 in ans) and (4 in ans) and (8 in ans) == True:
    print("Yes")
elif (1 in ans) and (4 in ans) and (7 in ans) == True:
    print("Yes")
elif (2 in ans) and (5 in ans) and (8 in ans) == True:
    print("Yes")
elif (2 in ans) and (4 in ans) and (6 in ans) == True:
    print("Yes")
elif (3 in ans) and (4 in ans) and (5 in ans) == True:
    print("Yes")
elif (6 in ans) and (7 in ans) and (8 in ans) == True:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

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

Submission attempts (in order):
A1=[int(e) for e in input().split()]
A2=[int(e) for e in input().split()]
A3=[int(e) for e in input().split()]
N=int(input())
for i in range(N):
    b=input()
    for j in range(3):
        if b==A1[j]:
            A1[j]= -1
        elif b==A2[j]:
            A2[j]= -1
        elif b==A3[j]:
            A3[j]= -1
if A1[0]==A2[0] and A2[0]==A3[0]:
    print('Yes')
elif A1[1]==A2[1] and A2[1]==A3[1]:
    print('Yes')
elif A1[2]==A2[2] and A2[2]==A3[2]:
    print('Yes')
elif A1[0]==A1[1] and A1[1]==A1[2]:
    print('Yes')
elif A2[0]==A2[1] and A2[1]==A2[2]:
    print('Yes')
elif A3[0]==A3[1] and A3[1]==A3[2]:
    print('Yes')
elif A1[0]==A2[1] and A2[1]==A3[2]:
    print('Yes')
elif A1[2]==A2[1] and A2[1]==A3[0]:
    print('Yes')
else:
    print('No')

A1=[int(e) for e in input().split()]
A2=[int(f) for f in input().split()]
A3=[int(g) for g in input().split()]
N=int(input())
for i in range(N):
    b=int(input())
    for j in range(3):
        if b==A1[j]:
            A1[j]= -1
        elif b==A2[j]:
            A2[j]= -1
        elif b==A3[j]:
            A3[j]= -1
if A1[0]==-1 and A2[0]==-1 and A3[0]==-1:
    print('Yes')
elif A1[1]==-1 and A2[1]==-1 and A3[1]==-1:
    print('Yes')
elif A1[2]==-1 and A2[2]==-1 and A3[2]==-1:
    print('Yes')
elif A1[0]==-1 and A1[1]==-1 and A1[2]==-1:
    print('Yes')
elif A2[0]==-1 and A2[1]==-1 and A2[2]==-1:
    print('Yes')
elif A3[0]==-1 and A3[1]==-1 and A3[2]==-1:
    print('Yes')
elif A1[0]==-1 and A2[1]==-1 and A3[2]==-1:
    print('Yes')
elif A3[0]==-1 and A2[1]==-1 and A1[2]==-1:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

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

Submission attempts (in order):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
d = [[0]*3]*3
for i in range(3):
  for j in range(3):
    b = int(input())
    if A[i][j] == b:
      d[i][j] = 1

ans = "No"

for i in range(3):
  if sum(d[i]) == 3:
    ans = "Yes"
    break
  if sum([D[i] for D in d]) == 3:
    ans = "Yes"
    break
if sum([d[i][i] for i in range(3)]) == 3:
  ans = "Yes"

if sum([d[i][2 - i] for i in range(3)]) == 3:
  ans = "Yes"
  
print(ans)

	
    
  

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

for  _ in range(N):
  b = int(input())
  for i in range(3):
    for j in range(3):
      if A[i][j] == b:
        d[i][j] = 1
        
ans = "No"
 
for i in range(3):
  if sum(d[i]) == 3:
    ans = "Yes"
    break
  if sum([D[i] for D in d]) == 3:
    ans = "Yes"
    break
if sum([d[i][i] for i in range(3)]) == 3:
  ans = "Yes"
 
if sum([d[i][2 - i] for i in range(3)]) == 3:
  ans = "Yes"
  
print(ans)
 

Verdicts: Runtime Error

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

Submission attempts (in order):
card = [list(map(int, input().split())) for i in range (3)]
N = int(input())
b = [int(input()) for i in range(N)]

for k in range(N):
  for i in range(3):
    for j in range(3):
      if card[i][j] == b[k]:
        card[i][j] = 0
      
print(card)


for i in range(3):
  if card[i] == [0, 0, 0]:
    
    print("Yes")
    exit()
  elif [x[i] for x in card] == [0, 0, 0]:
    
    print("Yes")
    exit()
    
if [card[i][i] for i in range(3)] == [0, 0, 0]:
  
  print("Yes")
  exit()
elif [card[2-i][i] for i in range(3)] == [0, 0, 0]:
  
  print("Yes")
  exit()
else:
  
  print("No")

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

for k in range(N):
  for i in range(3):
    for j in range(3):
      if card[i][j] == b[k]:
        card[i][j] = 0
      
#print(card)


for i in range(3):
  if card[i] == [0, 0, 0]:
    
    print("Yes")
    exit()
  elif [x[i] for x in card] == [0, 0, 0]:
    
    print("Yes")
    exit()
    
if [card[i][i] for i in range(3)] == [0, 0, 0]:
  
  print("Yes")
  exit()
elif [card[2-i][i] for i in range(3)] == [0, 0, 0]:
  
  print("Yes")
  exit()
else:
  
  print("No")

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
card = [ list(map(int,input().split())) for a in range(3) ]
N = int(input())
point = [ int(input()) for a in range(N) ]

# cut holes
for I in point:
    for J in card:
        if I in J:
            J.index(I)
            J[J.index(I)] = "H"
print(card)
# vertical check
for K in range(3):
    check = set([ x[K] for x in card ])
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# horizon check
for L in card:
    check = set(L)
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# diagonal check
LtoR = set([ card[M][M] for M in range(3)])
RtoL = set([ card[M][-M-1] for M in range(3)])
if len(LtoR) == 1 and list(LtoR)[0] == "H" or  len(RtoL) == 1 and list(RtoL)[0] == "H":    
    print('Yes')
    sys.exit()
print('No')

import sys
card = [ list(map(int,input().split())) for a in range(3) ]
N = int(input())
point = [ int(input()) for a in range(N) ]

# cut holes
for I in point:
    for J in card:
        if I in J:
            J.index(I)
            J[J.index(I)] = "H"
# vertical check
for K in range(3):
    check = set([ x[K] for x in card ])
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# horizon check
for L in card:
    check = set(L)
    if len(check) == 1 and list(check)[0] == "H":
        print('Yes')
        sys.exit()
# diagonal check
LtoR = set([ card[M][M] for M in range(3)])
RtoL = set([ card[M][-M-1] for M in range(3)])
if len(LtoR) == 1 and list(LtoR)[0] == "H" or  len(RtoL) == 1 and list(RtoL)[0] == "H":    
    print('Yes')
    sys.exit()
print('No')

Verdicts: Wrong Answer

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

Submission attempts (in order):
# Bingo
A = []
for _ in range(3):
    A += list(map(int, input().split()))
N = int(input())
for _ in range(N):
    b = int(input())
    if b in A:
        A[A.index(b)] = -1
        

diag = (sum(A[0::4]) == -3) | (sum(A[2:8:2]) == -3)
rows = (sum(A[:3]) == -3) | (sum(A[3:6]) == -3) | (sum(A[6:]) == -3)
cols = (sum(A[:7:3]) == -3) | (sum(A[1:8:3]) == -3) | (sum(A[2::3]) == -3)
ans = diag | rows | cols
print(A)
print(['No', 'Yes'][ans])

# Bingo
A = []
for _ in range(3):
    A += list(map(int, input().split()))
N = int(input())
for _ in range(N):
    b = int(input())
    if b in A:
        A[A.index(b)] = -1
        

diag = (sum(A[0::4]) == -3) | (sum(A[2:8:2]) == -3)
rows = (sum(A[:3]) == -3) | (sum(A[3:6]) == -3) | (sum(A[6:]) == -3)
cols = (sum(A[:7:3]) == -3) | (sum(A[1:8:3]) == -3) | (sum(A[2::3]) == -3)
ans = diag | rows | cols
print(['No', 'Yes'][ans])

Verdicts: Wrong Answer

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

Submission attempts (in order):
def checkbingo(bingo,bs):
  for b in bingo:
    cnt = 0
    for n in bs:
      if n in b:
        cnt +=1
    if cnt == 3:
      return True
  return False

list1 = input('').split(' ')
list2 = input('').split(' ')
list3 = input('').split(' ')
bingo = [list1,list2,list3]
for i in range(0,2):
  bingo.append([list1[i],list2[i],list3[i]])
bingo.append([list1[0],list1[1],list2[2]])
bingo.append([list1[2],list1[1],list2[0]])
max_n = int(input(''))
bs = []
result = False
for n in range(0,max_n):
  b = input('')
  bs.append(b)
if checkbingo(bingo,bs):
  result = True

if result == True:
    print("Yes")
else:
    print("No")



def checkbingo(bingo,bs):
  for b in bingo:
    cnt = 0
    for n in bs:
      if n in b:
        cnt +=1
    if cnt == len(b):
      return True
  return False

list1 = input('').split(' ')
list2 = input('').split(' ')
list3 = input('').split(' ')
bingo = [list1,list2,list3]
bingo.append([list1[0],list2[0],list3[0]])
bingo.append([list1[1],list2[1],list3[1]])
bingo.append([list1[2],list2[2],list3[2]])
bingo.append([list1[0],list1[1],list2[2]])
bingo.append([list1[2],list1[1],list2[0]])
max_n = int(input(''))
bs = []
result = False
for n in range(0,max_n):
  bs.append(input(''))

if checkbingo(bingo,bs):
    print("Yes")
else:
    print("No")



def checkbingo(bingo,bs):
  for b in bingo:
    cnt = 0
    for n in bs:
      if n in b:
        cnt +=1
    print("{}".format(cnt))
    if cnt == 3:
      return True
  return False

list1 = input('').split(' ')
list2 = input('').split(' ')
list3 = input('').split(' ')
bingo = [list1,list2,list3]
for i in range(0,2):
  bingo.append([list1[i],list2[i],list3[i]])
bingo.append([list1[0],list1[1],list2[2]])
bingo.append([list1[2],list1[1],list2[0]])
max_n = int(input(''))
bs = []
result = False
for n in range(0,max_n):
  b = input('')
  bs.append(b)
if checkbingo(bingo,bs):
  result = True

if result == True:
    print("Yes")
else:
    print("No")



def checkbingo(bingo,bs):
  for b in bingo:
    cnt = 0
    for n in bs:
      if n in b:
        cnt +=1
    if cnt == len(b):
      return True
  return False

list1 = input('').split(' ')
list2 = input('').split(' ')
list3 = input('').split(' ')
bingo = [list1,list2,list3]
bingo.append([list1[0],list2[0],list3[0]])
bingo.append([list1[1],list2[1],list3[1]])
bingo.append([list1[2],list2[2],list3[2]])
bingo.append([list1[0],list2[1],list3[2]])
bingo.append([list1[2],list2[1],list3[0]])
max_n = int(input(''))
bs = []
result = False
for n in range(0,max_n):
  bs.append(input(''))

if checkbingo(bingo,bs):
    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):

a = []
for i in range(3):
  inp = [int(x) for x in input().split()]
  a.append(inp)
n = int(input())
b = []
for i in range(n):
  b.append(input())
for i in range(n):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
if a[0][0] == 0 and a[0][1] == 0 and a[0][2] == 0:
  print('YES')
elif a[1][0] == 0 and a[1][1] == 0 and a[1][2] == 0:
  print('YES')
elif a[1][0] == 0 and a[1][1] == 0 and a[1][2] == 0:
  print('YES')
    
elif a[0][0] == 0 and a[1][0] == 0 and a[2][0] == 0:
  print('YES')
elif a[0][1] == 0 and a[1][1] == 0 and a[2][1] == 0:
  print('YES')
elif a[0][2] == 0 and a[1][2] == 0 and a[2][2] == 0:
  print('YES')
    
elif a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
  print('YES')
elif a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
  print('YES')
else:
  print('NO')

a = []
for i in range(3):
  inp = [int(x) for x in input().split()]
  a.append(inp)
n = int(input())
b = []
for i in range(n):
  b.append(int(input()))
for i in range(n):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
if a[0][0] == 0 and a[0][1] == 0 and a[0][2] == 0:
  print('YES')
elif a[1][0] == 0 and a[1][1] == 0 and a[1][2] == 0:
  print('YES')
elif a[1][0] == 0 and a[1][1] == 0 and a[1][2] == 0:
  print('YES')
    
elif a[0][0] == 0 and a[1][0] == 0 and a[2][0] == 0:
  print('YES')
elif a[0][1] == 0 and a[1][1] == 0 and a[2][1] == 0:
  print('YES')
elif a[0][2] == 0 and a[1][2] == 0 and a[2][2] == 0:
  print('YES')
    
elif a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
  print('YES')
elif a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 0:
  print('YES')
else:
  print('NO')

a = []
for i in range(3):
  inp = [int(x) for x in input().split()]
  a.append(inp)
n = int(input())
b = []
for i in range(n):
  b.append(int(input()))
for i in range(n):
  for j in range(3):
    for k in range(3):
      if a[j][k] == b[i]:
        a[j][k] = 0
if a[0][0] == 0 and a[0][1] == 0 and a[0][2] == 0:
  print('Yes')
elif a[1][0] == 0 and a[1][1] == 0 and a[1][2] == 0:
  print('Yes')
elif a[2][0] == 0 and a[2][1] == 0 and a[2][2] == 0:
  print('Yes')
    
elif a[0][0] == 0 and a[1][0] == 0 and a[2][0] == 0:
  print('Yes')
elif a[0][1] == 0 and a[1][1] == 0 and a[2][1] == 0:
  print('Yes')
elif a[0][2] == 0 and a[1][2] == 0 and a[2][2] == 0:
  print('Yes')
    
elif a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
  print('Yes')
elif a[0][2] == 0 and a[1][1] == 0 and a[2][0] == 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):
from collections import OrderedDict

f_row_nums = list(input().split())
s_row_nums = list(input().split())
t_row_nums = list(input().split())
N = int(input())
chosen_nums = [input() for _ in range(N)]

f_dict = OrderedDict()
for key in f_row_nums:
    print(key)
    f_dict[key] = False
s_dict = OrderedDict()
for key in s_row_nums:
    s_dict[key] = False
t_dict = OrderedDict()
for key in t_row_nums:
    t_dict[key] = False

for num in chosen_nums:
    if num in f_dict:
        f_dict[num] = True
    if num in s_dict:
        s_dict[num] = True
    if num in t_dict:
        t_dict[num] = True

f_rows = list(f_dict.values())
s_rows = list(s_dict.values())
t_rows = list(t_dict.values())
f_cols = [f_rows[0], s_rows[0], t_rows[0]]
s_cols = [f_rows[1], s_rows[1], t_rows[1]]
t_cols = [f_rows[2], s_rows[2], t_rows[2]]

out = 'No'

if all(f_rows) or all(s_rows) or all(t_rows) or all(f_cols) or all(s_cols) or all(t_cols):
    out = 'Yes'
elif f_rows[0] and s_rows[1] and t_rows[2]:
    out = 'Yes'
elif f_rows[2] and s_rows[1] and t_rows[0]:
    out = 'Yes'

print(out)


from collections import OrderedDict

f_row_nums = list(input().split())
s_row_nums = list(input().split())
t_row_nums = list(input().split())
N = int(input())
chosen_nums = [input() for _ in range(N)]

f_dict = OrderedDict()
for key in f_row_nums:
    f_dict[key] = False
s_dict = OrderedDict()
for key in s_row_nums:
    s_dict[key] = False
t_dict = OrderedDict()
for key in t_row_nums:
    t_dict[key] = False

for num in chosen_nums:
    if num in f_dict:
        f_dict[num] = True
    if num in s_dict:
        s_dict[num] = True
    if num in t_dict:
        t_dict[num] = True

f_rows = list(f_dict.values())
s_rows = list(s_dict.values())
t_rows = list(t_dict.values())

f_cols = [f_rows[0], s_rows[0], t_rows[0]]
s_cols = [f_rows[1], s_rows[1], t_rows[1]]
t_cols = [f_rows[2], s_rows[2], t_rows[2]]

out = "No"

if all(f_rows) or all(s_rows) or all(t_rows) or all(f_cols) or all(s_cols) or all(t_cols):
    out = "Yes"
elif f_rows[0] and s_rows[1] and t_rows[2]:
    out = "Yes"
elif f_rows[2] and s_rows[1] and t_rows[0]:
    out = "Yes"

print(out)


Verdicts: Wrong Answer

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

Submission attempts (in order):
# coding: utf-8
# Your code here!
ls = []
count = [0]*9
for i in range(3):
    ls.extend(input().split(' '))
for i in range(int(input())):
    s = input()
    if s in ls:
        i = ls.index(s)
        count[i]="1"
flag = 0
for i in range(3):
    if count[i] == count[i+3] == count[i+6]=="1":
        flag = 1
        break
if flag == 0:
	for i in range(0,8,3):
    	if count[i] == count[i+1] == count[i+2] == "1":
       		flag = 1
        	break
if count[0]==count[4]==count[8]=="1":
    flag = 1
if count[2] == count[4] == count[6] == "1":
    flag = 1
if flag == 1:
    print("Yes")
elif flag == 0:
    print("No")

# coding: utf-8
# Your code here!
ls = []
count = [0]*9
for i in range(3):
    ls.extend(input().split(' '))
for i in range(int(input())):
    s = input()
    if s in ls:
        i = ls.index(s)
        count[i]="1"
flag = 0
for i in range(3):
    if count[i] == count[i+3] == count[i+6]=="1":
        flag = 1
        break
for i in range(0,8,3):
    if count[i] == count[i+1] == count[i+2] == "1":
        flag = 1
        break
if count[0]==count[4]==count[8]=="1":
    flag = 1
if count[2] == count[4] == count[6] == "1":
    flag = 1
if flag == 1:
    print("Yes")
elif flag == 0:
    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):
bingo = [0,1,3,5,7,8]
if 4 in bingo:
    if 0 in bingo:
        if 8 in bingo:
            print('Yes')
            exit()
    if 1 in bingo:
        if 7 in bingo:
            print('Yes')
            exit()
    if 2 in bingo:
        if 6 in bingo:
            print('Yes')
            exit()
    if 3 in bingo:
        if 5 in bingo:
            print('Yes')
            exit()
if 0 in bingo:
    if 1 in bingo:
        if 2 in bingo:
            print('Yes')
            exit()
    if 3 in bingo:
        if 6 in bingo: 
            print('Yes')
            exit()
if 8 in bingo:
    if 2 in bingo:
        if 5 in bingo:
            print('Yes')
            exit()
    if 6 in bingo:
        if 7 in bingo:           
            print('Yes')
            exit()
print('No')
    

a11,a12,a13 = input().split()
a21,a22,a23 = input().split()
a31,a32,a33 = input().split()
lst = [a11,a12,a13,a21,a22,a23,a31,a32,a33]
bingo = []
n = int(input())
for i in range(n):
    ai = input()
    if ai in lst:
        bingo.append(lst.index(ai))
if 4 in bingo:
    if 0 in bingo:
        if 8 in bingo:
            print('Yes')
            exit()
    if 1 in bingo:
        if 7 in bingo:
            print('Yes')
            exit()
    if 2 in bingo:
        if 6 in bingo:
            print('Yes')
            exit()
    if 3 in bingo:
        if 5 in bingo:
            print('Yes')
            exit()
if 0 in bingo:
    if 1 in bingo:
        if 2 in bingo:
            print('Yes')
            exit()
    if 3 in bingo:
        if 6 in bingo: 
            print('Yes')
            exit()
if 8 in bingo:
    if 2 in bingo:
        if 5 in bingo:
            print('Yes')
            exit()
    if 6 in bingo:
        if 7 in bingo:           
            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=[]
for _ in range(3):
  A.append(list(map(int,input().split())))

def bingo(x):
  a=False
  for s in range(3):
    if sum(x[0])==3:a=True
  
  for h in range(3):
    if x[i][0]+x[i][1]+x[i][2]==3:a=True
      
  if x[0][0]+x[1][1]+x[2][2]==3:a=True
  
  if x[0][2]+x[1][1]+x[2][0]==3:a=True
    
  return a


for _ in range(int(input())):
  seen=[[0,0,0] for _ in range(3)]
  a=int(input())
  
  for i in range(3):
    for j in range(3):
      if A[i][j]==a:seen[i][j]=1
        
  ff=bingo(seen)
  if ff==True:
    print('Yes')
    exit()
      
print('No')


import numpy as np
A=[]
for _ in range(3):
  A.append(list(map(int,input().split())))

def bingo(x):
  a=False
  for s in range(3):
    if sum(x[s])==3:a=True
  
  for h in range(3):
    if x[0][h]+x[1][h]+x[2][h]==3:a=True
      
  if x[0][0]+x[1][1]+x[2][2]==3:a=True
  
  if x[0][2]+x[1][1]+x[2][0]==3:a=True
  
  return a

seen=[[0,0,0] for _ in range(3)]

for _ in range(int(input())):
  a=int(input())
  
  for i in range(3):
    for j in range(3):
      if A[i][j]==a:seen[i][j]=1

ff=bingo(seen)

if ff==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):
a11,a12,a13=(int(x) for x in input().split())
a21,a22,a23=(int(x) for x in input().split())
a31,a32,a33=(int(x) for x in input().split())
n=int(input())
list=[]
for i in range(n):
	list.append(int(input()))
s=set(list)

def ch(a,b,c,s):
	print(a,b,c,s)
	k=0
	if a in s:
		if b in s:
			if c in s:
				k=1
	return k
co=0
co+=ch(a11,a12,a13,s)
co+=ch(a21,a22,a23,s)
co+=ch(a31,a32,a33,s)
co+=ch(a11,a21,a31,s)
co+=ch(a12,a22,a32,s)
co+=ch(a13,a23,a33,s)
co+=ch(a11,a22,a33,s)
co+=ch(a13,a22,a31,s)
if co>0:
	print("Yes")
else:
	print("No")


a11,a12,a13=(int(x) for x in input().split())
a21,a22,a23=(int(x) for x in input().split())
a31,a32,a33=(int(x) for x in input().split())
n=int(input())
list=[]
for i in range(n):
	list.append(int(input()))
s=set(list)

def ch(a,b,c,s):
	k=0
	if a in s:
		if b in s:
			if c in s:
				k=1
	return k
co=0
co+=ch(a11,a12,a13,s)
co+=ch(a21,a22,a23,s)
co+=ch(a31,a32,a33,s)
co+=ch(a11,a21,a31,s)
co+=ch(a12,a22,a32,s)
co+=ch(a13,a23,a33,s)
co+=ch(a11,a22,a33,s)
co+=ch(a13,a22,a31,s)
if co>0:
	print("Yes")
else:
	print("No")


Verdicts: Wrong Answer

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

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

for b in range(N):
    if b in A:
        A[A.index(b)] = 0
    elif A[0] + A[1] + A[2] == 0:
        print("Yes")
        exit()
    elif A[3] + A[4] + A[5] == 0:
        print("Yes")
        exit()
    elif A[6] + A[7] + A[8] == 0:
        print("Yes")
        exit()
    elif A[0] + A[3] + A[6] == 0:
        print("Yes")
        exit()
    elif A[1] + A[4] + A[7] == 0:
        print("Yes")
        exit()
    elif A[2] + A[5] + A[8] == 0:
        print("Yes")
        exit()
    elif A[0] + A[4] + A[8] == 0:
        print("Yes")
        exit()
    elif A[2] + A[4] + A[6] == 0:
        print("Yes")
        exit()

print("No")

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

for _ in range(N):
    b = int(input())
    if b in A:
        A[A.index(b)] = 0
    if (
        A[0] + A[1] + A[2] == 0
        or A[3] + A[4] + A[5] == 0
        or A[6] + A[7] + A[8] == 0
        or A[0] + A[3] + A[6] == 0
        or A[1] + A[4] + A[7] == 0
        or A[2] + A[5] + A[8] == 0
        or A[0] + A[4] + A[8] == 0
        or A[2] + A[4] + A[6] == 0
    ):
        print("Yes")
        break
else:
    print("No")

Verdicts: Wrong Answer

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

Submission attempts (in order):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
B = [list(map(int, input().split())) for i in range(N)]
c = [[0] * 3 for _ in range(3)]
for b in B:
  for i in range(3):
    for j in range(3):
      if A[i][j] == b:
        c[i][j] == 1
for i in range(3):
    if c[i][0] and c[i][1] and c[i][2]:
        print('Yes')
        exit()
    if c[0][i] and c[1][i] and c[2][i]:
        print('Yes')
        exit()
if c[0][0] and c[1][1] and c[2][2]:
    print('Yes')
    exit()
if c[0][2] and c[1][1] and c[2][0]:
    print('Yes')
    exit()
print('No')

bingo = [list(map(int,input().split())) for _ in range(3)]
n = int(input())
l = [int(input()) for _ in range(n)]
for i in range(3):
    if bingo[i][0] in l and bingo[i][1] in l and bingo[i][2] in l:
        print("Yes")
        exit()
for i in range(3):
    if bingo[0][i] in l and bingo[1][i] in l and bingo[2][i] in l:
        print("Yes")
        exit()
if bingo[0][0] in l and bingo[1][1] in l and bingo[2][2] in l:
    print("Yes")
    exit()
if bingo[0][2] in l and bingo[1][1] in l and bingo[2][0] in l:
    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):
A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))
A3 = list(map(int,input().split()))
N = int(input())
b = [0] * N 
for i in range(N):
    b[i] = int(input())
A = [A1,A2,A3]
B = [[0]*3,[0]*3,[0]*3]
for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] == b[k]:
                B[i][j] = 1
if B[0] == [1,1,1]:
    print("Yes")
elif B[1] == [1,1,1]:
    print("Yes")
elif B[2] == [1,1,1]:
    print("Yes")
elif B[0][0] == 1 and B[1][0] == 1 and B[2][0] == 1:
    print("Yes")
elif B[0][1] == 1 and B[1][1] == 1 and B[2][1] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][2] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][0] == 1 and B[1][1] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][1] == 1 and B[2][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 = [0] * N 
for i in range(N):
    b[i] = int(input())
A = [A1,A2,A3]
B = [[0]*3,[0]*3,[0]*3]
for i in range(3):
    for j in range(3):
        for k in range(N):
            if A[i][j] == b[k]:
                B[i][j] = 1
if B[0] == [1,1,1]:
    print("Yes")
elif B[1] == [1,1,1]:
    print("Yes")
elif B[2] == [1,1,1]:
    print("Yes")
elif B[0][0] == 1 and B[1][0] == 1 and B[2][0] == 1:
    print("Yes")
elif B[0][1] == 1 and B[1][1] == 1 and B[2][1] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][2] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][0] == 1 and B[1][1] == 1 and B[2][2] == 1:
    print("Yes")
elif B[0][2] == 1 and B[1][1] == 1 and B[2][0] == 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):
mark = []
for i in range(N):
    b = int(input())
    for j, a in enumerate(A):
        for k, aa in enumerate(a):
            if aa == b:
                mark.append((j,k))



if ( ((0,0) and (1,1) and (2,2)) or ((0,2) and (1,1) and (2,0)) ) in mark:
    print("Yes")
    exit()
else:
    for i in range(3):
        if ((i,0) and (i,1) and (i,2)) in mark:
            print('Yes')
            exit()
        if ((0,i) and (1,i) and (2,i)) in mark:
            print("Yes")
            exit()

print("No")


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

mark = [[0]*3, [0]*3, [0]*3]

for i in range(N):
    b = int(input())
    for j, a in enumerate(A):
        for k, aa in enumerate(a):
            if aa == b:
                mark[j][k] = 1


if mark[0][0] == mark[1][1] == mark[2][2] == 1 or  mark[0][2] == mark[1][1] == mark[2][0] == 1:
    print("Yes")
    exit()
else:
    for i in range(3):
        if mark[i][0] == mark[i][1] == mark[i][2] == 1:
            print('Yes')
            exit()
        if mark[0][i] == mark[1][i] == mark[2][i] == 1:
            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):
#7
a = [[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
bingo = 0

for i in range(3):
    if a[i][0] == a[i][1] == a[i][2] == -1:
        bingo = 1
        
for j in range(3):
    if a[0][j] == a[1][j] == a[2][j] == -1:
        bingo = 1

if a[0][0] == a[1][1] == a[2][2] == -1 or a[0][2] == a[1][1] == a[2][0]:
    bingo = 1

if bingo == True:
    print('Yes')

else:
    print('No')


#7
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
bingo = 0

for i in range(3):
    if a[i][0] == a[i][1] == a[i][2] == -1:
        bingo = 1
        
for j in range(3):
    if a[0][j] == a[1][j] == a[2][j] == -1:
        bingo = 1

if a[0][0] == a[1][1] == a[2][2] == -1 or a[0][2] == a[1][1] == a[2][0]:
    bingo = 1

if bingo == 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(list(map(int , input().split())) for l in range(3))
n = int(input())

for i in range(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)

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


Verdicts: 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
import math
sys.setrecursionlimit(int(1e6))

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

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

card = [[0]*3]*3
n = 0
for bn in b:
    for m in range(3*3):
        i = m % 3
        j = m // 3
        if (A[i][j] == bn):
            card[i][j] = 1
            break

ans = 'No'
for i in range(3):
    if sum(A[i]) == 3:
        ans = 'Yes'
        break
    if sum([A[0][i], A[1][i], A[2][i]]) == 3:
        ans = 'Yes'
        break
else:
    if sum([A[0][0], A[1][1], A[2][2]]) == 3:
        ans = 'Yes'
    elif sum([A[2][0], A[1][1], A[0][2]]) == 3:
        ans = 'Yes'

print(ans)


import sys
import math
sys.setrecursionlimit(int(1e6))

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

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

c = [[0]*3 for i in range(3)]
for bn in b:
    for m in range(3*3):
        i = m % 3
        j = m // 3
        if (A[i][j] == bn):
            c[i][j] = 1
            break

ans = 'No'
for i in range(3):
    if sum(c[i]) == 3:
        ans = 'Yes'
        break
    if sum([c[0][i], c[1][i], c[2][i]]) == 3:
        ans = 'Yes'
        break
else:
    if sum([c[0][0], c[1][1], c[2][2]]) == 3:
        ans = 'Yes'
    elif sum([c[2][0], c[1][1], c[0][2]]) == 3:
        ans = 'Yes'

print(ans)


Verdicts: Wrong Answer

Accepted