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

AList = []
BingoList = [[0, 0, 0],
             [0, 0, 0],
             [0, 0, 0]]

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

N = int(input())

tmp = -1
for i in range(N):
    tmp = int(input())
    for p in range(3):
        for q in range(3):
            if AList[p][q] == tmp:
                BingoList[i][q] = 1

for i in range(3):
    if BingoList[i][0] == 1 and BingoList[i][1] == 1 and BingoList[i][2] == 1:
        print('Yes')
        sys.exit(0)

for i in range(3):
    if BingoList[0][i] == 1 and BingoList[1][i] == 1 and BingoList[2][i] == 1:
        print('Yes')
        sys.exit(0)

if BingoList[0][0] == 1 and BingoList[1][1] == 1 and BingoList[2][2] == 1:
    print('Yes')
elif BingoList[2][0] == 1 and BingoList[1][1] == 1 and BingoList[0][2] == 1:
    print('Yes')
else:
    print('No')

import sys

AList = []
BingoList = [[0, 0, 0],
             [0, 0, 0],
             [0, 0, 0]]

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

N = int(input())

tmp = -1
for i in range(N):
    tmp = int(input())
    for p in range(3):
        for q in range(3):
            if AList[p][q] == tmp:
                BingoList[i][q] = 1

for i in range(3):
    if BingoList[i][0] == 1 and BingoList[i][1] == 1 and BingoList[i][2] == 1:
        print('Yes')
        sys.exit(0)

for i in range(3):
    if BingoList[0][i] == 1 and BingoList[1][i] == 1 and BingoList[2][i] == 1:
        print('Yes')
        sys.exit(0)

if BingoList[0][0] == 1 and BingoList[1][1] == 1 and BingoList[2][2] == 1:
    print('Yes')
elif BingoList[2][0] == 1 and BingoList[1][1] == 1 and BingoList[0][2] == 1:
    print('Yes')
else:
    print('No')

import sys

AList = []
BingoList = [[0, 0, 0],
             [0, 0, 0],
             [0, 0, 0]]

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

N = int(input())

tmp = -1
for i in range(N):
    tmp = int(input())
    for p in range(3):
        for q in range(3):
            if AList[p][q] == tmp:
                BingoList[p][q] = 1

for i in range(3):
    if BingoList[i][0] == 1 and BingoList[i][1] == 1 and BingoList[i][2] == 1:
        print('Yes')
        sys.exit(0)

for i in range(3):
    if BingoList[0][i] == 1 and BingoList[1][i] == 1 and BingoList[2][i] == 1:
        print('Yes')
        sys.exit(0)

if BingoList[0][0] == 1 and BingoList[1][1] == 1 and BingoList[2][2] == 1:
    print('Yes')
elif BingoList[2][0] == 1 and BingoList[1][1] == 1 and BingoList[0][2] == 1:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
A = []
for i in range(3):
  A1,A2,A3 = map(int,input().split())
  A.append(int(A1))
  A.append(int(A2))
  A.append(int(A3))

N = int(input())
b = []

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

match = ''

for star in b:
  for i, item in enumerate(A):
    if item == star:
      match += str(i)

match = sorted(match)
match = ''.join(match)

print(match)

if '012' in match:
  print('Yes')
elif '345' in match:
  print('Yes')
elif '678' in match:
  print('Yes')
elif '0' in match:
  if '3' in match:
    if '6' in match:
      print('Yes')
  if '4' in match:
    if '8' in match:
      print('Yes')
elif '1' in match:
  if '4' in match:
    if '7' in match:
      print('Yes')
elif '2' in match:
  if '4' in match:
    if '6' in match:
      print('Yes')
  if '5' in match:
    if '8' in match:
      print('Yes')
else:
  print('No')

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

N = int(input())
b = []

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

match = ''

for star in b:
  for i, item in enumerate(A):
    if item == star:
      match += str(i)

match = sorted(match)
match = ''.join(match)

if '012' in match:
  print('Yes')
elif '345' in match:
  print('Yes')
elif '678' in match:
  print('Yes')
elif '0' in match:
  if '3' in match:
    if '6' in match:
      print('Yes')
  elif '4' in match:
    if '8' in match:
      print('Yes')
elif '1' in match:
  if '4' in match:
    if '7' in match:
      print('Yes')
elif '2' in match:
  if '4' in match:
    if '6' in match:
      print('Yes')
  elif '5' in match:
    if '8' in match:
      print('Yes')
else:
  print('No')

row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))
n = int(input())
arr = []
for i in range(n):
    temp = int(input())
    arr.append(temp)
#
if row1[0] in arr and row1[1] in arr and row1[2] in arr or row2[0] in arr and row2[1] in arr and row2[2] in arr or row3[0] in arr and row3[1] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[0] in arr and row3[0] in arr or row1[1] in arr and row2[1] in arr and row3[1] in arr or row1[2] in arr and row2[2] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[1] in arr and row3[2] in arr or row1[2] in arr and row2[1] in arr and row3[0] in arr:
    print("Yes")
    exit()
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))

l1=[a1[0],a2[0],a3[0]]
l2=[a1[1],a2[1],a3[1]]
l3=[a1[2],a2[2],a3[2]]
l4=[a1[0],a1[1],a1[2]]
l5=[a2[0],a2[1],a2[2]]
l6=[a3[0],a3[1],a3[2]]
l7=[a1[0],a2[1],a3[2]]
l8=[a1[2],a2[1],a3[0]]

N=int(input())
for i in range(N):
  b=int(input())
  try:
    a1.remove(b)
  else:
    pass
  try:
    a2.remove(b)
  else:
    pass
  try:
    a3.remove(b)
  else:
    pass
if(sum(l1)==0 or sum(l2)==0 or sum(l3)==0 or sum(l4)==0 or sum(l5)==0 or sum(l6)==0 or sum(l7)==0 or sum(l1)==8):
  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())
for i in range(N):
  b=int(input())
  if(a1[0]==b):
    a1[0]=0
  if(a1[1]==b):
    a1[1]=0
  if(a1[2]==b):
    a1[2]=0
  if(a2[0]==b):
    a2[0]=0
  if(a2[1]==b):
    a2[1]=0
  if(a2[2]==b):
    a2[2]=0
  if(a3[0]==b):
    a3[0]=0
  if(a3[1]==b):
    a3[1]=0
  if(a3[2]==b):
    a3[2]=0                                   
l1=[a1[0],a2[0],a3[0]]
l2=[a1[1],a2[1],a3[1]]
l3=[a1[2],a2[2],a3[2]]
l4=[a1[0],a1[1],a1[2]]
l5=[a2[0],a2[1],a2[2]]
l6=[a3[0],a3[1],a3[2]]
l7=[a1[0],a2[1],a3[2]]
l8=[a1[2],a2[1],a3[0]]
if(sum(l1)==0 or sum(l2)==0 or sum(l3)==0 or sum(l4)==0 or sum(l5)==0 or sum(l6)==0 or sum(l7)==0 or sum(l8)==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):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = input()
b = [(int(input())) for _ in range(N)]

print(A1)


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

bingo1 = [0, 0, 0]
bingo2 = [0, 0, 0]
bingo3 = [0, 0, 0]


for i in range(3):
  for j in range(N):
    if A[i][0] == b[j]:
      bingo1[i] = 1
    if A[i][1] == b[j]:
      bingo2[i] = 1
    if A[i][2] == b[j]:
      bingo3[i] = 1
      


if bingo1[0] == bingo1[1] == bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == bingo2[1] == bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == bingo3[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[0] == bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == bingo2[1] == bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == bingo2[2] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[2] == bingo2[1] == bingo3[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):
a_list = []
for i in range(3):
    for j in list(map(int, input().split())):
        a_list.append()

N = int(input())

b_list = []
for i in range(N):
    b_list.append(int(input()))    
        
for b in b_list:
    if b in a_list:
        a_list[a_list.index(b)] = 0
# 123
# 456
# 789

line_list = [
    a_list[:3],    # 123
    a_list[3:6],   # 456
    a_list[6:9],   # 789
    a_list[::3],   # 147
    a_list[1::3],  # 258
    a_list[2::3],  # 369
    a_list[::4],   # 159
    a_list[2:7:2], # 357    
]
line_sum_list = list(map(sum, line_list))
if 0 in line_sum_list:
    print('Yes')
else:
    print('No') 

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

N = int(input())

b_list = []
for i in range(N):
    b_list.append(int(input()))    
        
for b in b_list:
    if b in a_list:
        a_list[a_list.index(b)] = 0
# 123
# 456
# 789

line_list = [
    a_list[:3],    # 123
    a_list[3:6],   # 456
    a_list[6:9],   # 789
    a_list[::3],   # 147
    a_list[1::3],  # 258
    a_list[2::3],  # 369
    a_list[::4],   # 159
    a_list[2:7:2], # 357    
]
line_sum_list = list(map(sum, line_list))
if 0 in line_sum_list:
    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=[]
b=[]
for _ in range(3):
    a.append(list(map(int,input().split())))
for _ in range(int(input())):
    b.append(int(input()))
for i in range(N):
    for j in range(3):
        for k in range(3):
            if b[i]==a[k][j]:
                a[k][j]=0
if (a[0][0]==0 and a[0][1]==0 and a[0][2]==0)or(a[1][0]==0 and a[1][1]==0 and a[1][2]==0) or (a[2][0]==0 and a[2][1]==0 and a[2][2]==0) or (a[0][0]==0 and a[1][0]==0 and a[2][0]==0) or (a[0][1]==0 and a[1][1]==0 and a[2][1]==0) or (a[0][2]==0 and a[1][2]==0 and a[2][2]==0) or (a[0][0]==0 and a[1][1]==0 and a[2][2]==0) or (a[0][2]==0 and a[1][1]==0 and a[2][0]==0):
    print("Yes")
else:
    print("No")

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

Verdicts: Runtime Error

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

Submission attempts (in order):
a =[ list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

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

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

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

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

print("No")
exit()

Verdicts: Wrong Answer

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

Submission attempts (in order):
A = []
B = [0]*9


for _ in range(3):
    A += [int(i) for i in input().split()]


n=int(input())
for _ in range(n):
    b = int(input())
    for i, a in enumerate(A):
        if b == a:
            B[i] = 1


C = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
flag = 0


for a,b,c in C:
    if B[a-1] and B[b-1] and B[c-1]:
        flag = 1
print('Yes' if Chk else 'No')

A = []
B = [0]*9


for _ in range(3):
    A += [int(i) for i in input().split()]


n=int(input())
for _ in range(n):
    b = int(input())
    for i, a in enumerate(A):
        if b == a:
            B[i] = 1


C = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]]
flag = 0


for a,b,c in C:
    if B[a-1] and B[b-1] and B[c-1]:
        flag = 1
print('Yes' if flag else 'No')

Verdicts: Runtime Error

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

Submission attempts (in order):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
result = 'No'

n = int(input())
for i in range(n):
	In = int(input())
    
	a1 = ['' if a1[j] == In else a1[j] for j in range(3)]
	a2 = ['' if a2[j] == In else a2[j] for j in range(3)]
	a3 = ['' if a3[j] == In else a3[j] for j in range(3)]

print(a1)
print(a2)
print(a3)
# tate
for i in range(2):
	if a1[i] == '' and a2[i] == '' and a3[i] == '':
		result = 'Yes'
		break
# yoko
if a1.count('') == 3:
		result = 'Yes'
if a2.count('') == 3:
		result = 'Yes'
if a3.count('') == 3:
		result = 'Yes'

# naname
if a1[0] == '' and a2[1] == '' and a3[2] == '':
		result = 'Yes'
    
if a1[2] == '' and a2[1] == '' and a3[1] == '':
		result = 'Yes'
print(result)

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
result = 'No'

n = int(input())
for i in range(n):
	In = int(input())
    
	a1 = ['' if a1[j] == In else a1[j] for j in range(3)]
	a2 = ['' if a2[j] == In else a2[j] for j in range(3)]
	a3 = ['' if a3[j] == In else a3[j] for j in range(3)]
    
# tate
for i in range(3):
	if a1[i] == '' and a2[i] == '' and a3[i] == '':
		result = 'Yes'
		break
# yoko
if a1.count('') == 3:
		result = 'Yes'
if a2.count('') == 3:
		result = 'Yes'
if a3.count('') == 3:
		result = 'Yes'

# naname
if a1[0] == '' and a2[1] == '' and a3[2] == '':
		result = 'Yes'
    
if a1[2] == '' and a2[1] == '' and a3[0] == '':
		result = 'Yes'
print(result)

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):
n1 = list(map(int, input().split()))
n2 = list(map(int, input().split()))
n3 = list(map(int, input().split()))
arr = []
z=0
for i in range(10):
    arr.append(int(input()))
    if arr[i] == n1[0] or arr[i] == n1[1] or arr[i] == n1[2] or arr[i] == n2[0] or arr[i] == n2[1] or arr[i] == n2[2] or arr[i] == n3[0] or arr[i] == n3[1] or arr[i] == n3[2]:
        z+=1
if z >= 3: print("Yes")
else: print("No")

n1 = list(map(int, input().split()))
n2 = list(map(int, input().split()))
n3 = list(map(int, input().split()))
arr = []
z=0
for i in range(10):
    arr.append(int(input()))
    if arr[i] == n1[0] or arr[i] == n1[1] or arr[i] == n1[2] or arr[i] == n2[0] or arr[i] == n2[1] or arr[i] == n2[2] or arr[i] == n3[0] or arr[i] == n3[1] or arr[i] == n3[2]:
        z+=1
if z >= 3: print("Yes")
else: print("No")

row1 = list(map(int,input().split()))
row2 = list(map(int,input().split()))
row3 = list(map(int,input().split()))
n = int(input())
arr = []
for i in range(n):
    temp = int(input())
    arr.append(temp)
#
if row1[0] in arr and row1[1] in arr and row1[2] in arr or row2[0] in arr and row2[1] in arr and row2[2] in arr or row3[0] in arr and row3[1] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[0] in arr and row3[0] in arr or row1[1] in arr and row2[1] in arr and row3[1] in arr or row1[2] in arr and row2[2] in arr and row3[2] in arr:
    print("Yes")
    exit()
elif row1[0] in arr and row2[1] in arr and row3[2] in arr or row1[2] in arr and row2[1] in arr and row3[0] in arr:
    print("Yes")
    exit()
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):

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

X = []
X += [set(A[i]) for i in range(3)]
X += [set([A[j][i] for j in range(3)]) for i in range(3)]
X += [set([A[0][2], A[1][1], A[2][0]]), set([A[2][2], A[1][1], A[0][0]])]

for x in X:
    if x in B:
        print('Yes')
        break
else:
    print('No')

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

X = []
X += [set(A[i]) for i in range(3)]
X += [set([A[j][i] for j in range(3)]) for i in range(3)]
X += [set([A[0][2], A[1][1], A[2][0]]), set([A[2][2], A[1][1], A[0][0]])]

for x in X:
    if x <= B: 
        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):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = a1+a2+a3
n = int(input())
b = list(int(input()) for _ in range(n))

for i in b:
    if i in a :
        a[a.index(a)] = "h"

if a[0:3].count("h") == 3 or a[3:6].count("h") == 3 or a[6:9].count("h") == 3:
    print("Yes")
elif a[0] == "h" and a[4] == "h" and a[8] == "h":
    print("Yes")
elif a[2] == "h" and a[4] == "h" and a[6] == "h":
    print("Yes")
elif a[0] == "h" and a[3] == "h" and a[6] == "h":
    print("Yes") 
elif a[1] == "h" and a[4] == "h" and a[7] == "h":
    print("Yes") 
elif a[2] == "h" and a[5] == "h" and a[8] == "h":
    print("Yes") 
else:
    print("No")

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

for i in b:
    if i in a :
        a[a.index(i)] = "h"

if a[0:3].count("h") == 3 or a[3:6].count("h") == 3 or a[6:9].count("h") == 3:
    print("Yes")
elif a[0] == "h" and a[4] == "h" and a[8] == "h":
    print("Yes")
elif a[2] == "h" and a[4] == "h" and a[6] == "h":
    print("Yes")
elif a[0] == "h" and a[3] == "h" and a[6] == "h":
    print("Yes") 
elif a[1] == "h" and a[4] == "h" and a[7] == "h":
    print("Yes") 
elif a[2] == "h" and a[5] == "h" and a[8] == "h":
    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):
bingo = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
number = [int(input()) for _ in range(N)]

check = [0 for _ in range(3)]

for i in range(N):
  for j in range(3):
    for k in range(3):
      if bingo[j][k] == N[i]:
        check[j][k] = 1
        
ans = 'No'
for i in range(3):
  if check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1:
    ans = 'Yes'
    
for i in range(3):
  if check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1:
    ans = 'Yes'
    
if check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1:
  ans = 'Yes'
  
if check[0][2] == 1 and check[1][1] == 1 and check[2][0] == 1:
  ans = 'Yes'
  
print(ans)
  

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

check = [[0 for _ in range(3)] for _ in range(3)]

for i in range(N):
  for j in range(3):
    for k in range(3):
      if bingo[j][k] == N[i]:
        check[j][k] = 1
        
ans = 'No'
for i in range(3):
  if check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1:
    ans = 'Yes'
    
for i in range(3):
  if check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1:
    ans = 'Yes'
    
if check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1:
  ans = 'Yes'
  
if check[0][2] == 1 and check[1][1] == 1 and check[2][0] == 1:
  ans = 'Yes'
  
print(ans)

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

check = [[0 for _ in range(3)] for _ in range(3)]

for i in range(N):
  for j in range(3):
    for k in range(3):
      if bingo[j][k] == number[i]:
        check[j][k] = 1
        
ans = 'No'
for i in range(3):
  if check[i][0] == 1 and check[i][1] == 1 and check[i][2] == 1:
    ans = 'Yes'
    
for i in range(3):
  if check[0][i] == 1 and check[1][i] == 1 and check[2][i] == 1:
    ans = 'Yes'
    
if check[0][0] == 1 and check[1][1] == 1 and check[2][2] == 1:
  ans = 'Yes'
  
if check[0][2] == 1 and check[1][1] == 1 and check[2][0] == 1:
  ans = 'Yes'
  
print(ans)


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
*inputs, = map(int, open(0).read().split())
A = inputs[:9]
B = inputs[9:]

C = [0] * 9
for b in B:
  if b in A:
    C[A.index(b)] = 1
    
if any([
     all(C[:3]), all(C[3:6]), all(C[6:]),
     all(C[::3]), all(C[1::3]), all(C[2::3]),
     all([C[0], C[4], C[8]]), all([C[2], C[4], C[6]])
    ]):
  print('Yes')
else:
  print('No')
print(C)

*inputs, = map(int, open(0).read().split())
A = inputs[:9]
B = inputs[9:]

C = [0] * 9
for b in B:
  if b in A:
    C[A.index(b)] = 1
    
if any([
     all(C[:3]), all(C[3:6]), all(C[6:]),
     all(C[::3]), all(C[1::3]), all(C[2::3]),
     all([C[0], C[4], C[8]]), all([C[2], C[4], C[6]])
    ]):
  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):
#!/usr/bin/env python3
import sys


def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1

for i in [0,3,6]:
    tate = ban[i]+ban[i+3]+ban[i+6]
    yoko = ban[i]+ban[i+1]+ban[i+2]
    if tate == 3 or yoko == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    print("Yes")
    exit()
print("No")

#!/usr/bin/env python3
import sys


def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a0 = inn()
a1 = inn()
a2 = inn()
a = a0+a1+a2
n = int(input())
ban = [0,0,0,0,0,0,0,0,0]
for i in range(n):
    b = int(input())
    for j in range(9):
        if b == a[j]:
            ban[j] = 1


for i in [0,1,2]:
    t = ban[i]+ban[i+3]+ban[i+6]
    if t == 3:
        print("Yes")
        exit()
for i in [0,3,6]:
    t = ban[i]+ban[i+1]+ban[i+2]
    if t == 3:
        print("Yes")
        exit()
if (ban[0]+ban[4]+ban[8]) == 3 or (ban[2]+ban[4]+ban[6]) == 3:
    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):
60 88 34
92 41 43
65 73 48
10
60
43
88
11
48
73
65
41
92
34

import sys

ar = []
x = sys.stdin.readline()
x = x.split(' ')
ar.extend([int(str) for str in x])
x = sys.stdin.readline()
x = x.split(' ')
ar.extend([int(str) for str in x])
x = sys.stdin.readline()
x = x.split(' ')
ar.extend([int(str) for str in x])

n = int(sys.stdin.readline())
ret = []
for i in range(n):
  b = int(sys.stdin.readline())
  if( b in ar):
    index = ar.index(b)
    ret.append(index)

result = "No"
for i in range(0,3):
  if( i*3+0 in ret and i*3+1 in ret and i*3+2 in ret ):
    result = "Yes"
  if( i+0*3 in ret and i+1*3 in ret and i+2*3 in ret ):
    result = "Yes"
if( 0 in ret and 4 in ret and 8 in ret ):
  result = "Yes"
if( 2 in ret and 4 in ret and 6 in ret ):
  result = "Yes"

print(result)



sys.stdout.flush()


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):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
grid = []
for _ in range(3):
    array = list(map(int, input().strip().split()))
    grid.append(array)

def judge():
    for i in range(3):
        if grid[i][0] == 0 and grid[i][1] == 0 and grid[i][2]:
            return True
    if grid[0][0] == 0 and grid[1][1] == 0 and grid[2][2] == 0:
        return True
    if grid[0][2] == 0 and grid[1][1] == 0 and grid[2][0] == 0:
        return True
    return False

n = int(input())
ans = "No"
for _ in range(n):
    b = int(input())
    for i in range(3):
        if b in grid[i]:
            grid[i][grid[i].index(b)] = 0
    if judge():
        ans = "Yes"
    print (grid)

print (ans)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
grid = []
for _ in range(3):
    array = list(map(int, input().strip().split()))
    grid.append(array)

def judge():
    for i in range(3):
        if grid[i][0] == 0 and grid[i][1] == 0 and grid[i][2] == 0:
            return True
        if grid[0][i] == 0 and grid[1][i] == 0 and grid[2][i] == 0:
            return True
    if grid[0][0] == 0 and grid[1][1] == 0 and grid[2][2] == 0:
        return True
    if grid[0][2] == 0 and grid[1][1] == 0 and grid[2][0] == 0:
        return True
    return False

n = int(input())
ans = "No"
for _ in range(n):
    b = int(input())
    for i in range(3):
        if b in grid[i]:
            grid[i][grid[i].index(b)] = 0
    if judge():
        ans = "Yes"
#    print (grid)

print (ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = [[0]*3]*3
for i in range(3):
  a[i] = list(map(int,input().split()))
  
  
def isInList(b,a):
  for i in range(len(a)):
    for j in range(len(a[i])):
      if a[i][j] == b:
        return i,j
      
  return 0,0
  
N = int(input())
for i in range(N):
  b = int(input())
  I,J = isInList(b,a)
  if I != 0:
    a[I][J] = -1
    
def judge(a):
  for i in range(3):
    if a[i][0] == -1 and a[i][1] == -1 and a[i][2] == -1:
      return True
  for i in range(3):
    if a[0][i] == -1 and a[1][i] == -1 and a[2][i] == -1:
      return True
  tmp = [a[i][i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  tmp = [a[i][2-i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  return False


ans = "Yes" if judge(a) else "No"
print(ans)
    

a = [[0]*3]*3
for i in range(3):
  a[i] = list(map(int,input().split()))
  
def isInList(b,a):
  for i in range(len(a)):
    for j in range(len(a[i])):
      if a[i][j] == b:
        return i,j
      
  return -1,-1
  
N = int(input())
for i in range(N):
  b = int(input())
  I,J = isInList(b,a)
  if I != -1:
    a[I][J] = -1
    

def judge(a):
  for i in range(3):
    if a[i][0] == -1 and a[i][1] == -1 and a[i][2] == -1:
      return True
  for i in range(3):
    if a[0][i] == -1 and a[1][i] == -1 and a[2][i] == -1:
      return True
  tmp = [a[i][i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  tmp = [a[i][2-i] for i in range(3)]
  if tmp == [-1,-1,-1]:
    return True
  return False


ans = "Yes" if judge(a) else "No"
print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
#!/usr/bin/env python3

def main():
    N = map(int, open(0).read().split())


main()

#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    A = N[0:9]
    N_number = N[9]
    b = N[10:]

    Ab_comm = set(A) & set(b)
    A_rep = [0 if i in Ab_comm else i for i in A]

    Ax=[]
    Ay=[]
    for i in range(0,3):
        Ax.append(A_rep[3*i] + A_rep[3*i + 1] + A_rep[3*i + 2])
        Ay.append(A_rep[i] + A_rep[i + 3] + A_rep[i + 6])
    An=[]
    An.append(A_rep[0] + A_rep[4] + A_rep[8])
    An.append(A_rep[2] + A_rep[4] + A_rep[6])
    if min(Ax + Ay + An) == 0:
        print("Yes")
    else:
        print("No")
        

main()

Verdicts: Wrong Answer

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

Submission attempts (in order):
n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]
tmp = [-1]*n
for j in range(m):
         if tmp[(sc[j][0]-1)] != sc[j][1]:
                  if tmp[(sc[j][0]-1)] != -1:
                           print(-1)
                           exit()
         tmp[(sc[j][0]-1)] = sc[j][1]
if tmp[0] == -1 and len(tmp) >= 2:
         print(-1)
         exit()
elif tmp[0] == -1 and len(tmp) == 1:
         print(0)
         exit()
else:
         for k in range(n):
                  if tmp[k] == -1:
                           tmp[k] = 0
                  print("{}".format(tmp[k]), end = "")


a = []
for i in range(3):
         a.append( list(map(int,input().split())))
n = int(input())
b = [int(input()) for j in range(n)]
for k in range(3):
         for l in range(3):
                  for m in range(n):
                           if a[k][l] == b[m]:
                                    a[k][l] = -1
if a[0][0] == a[0][1] == a[0][2] == -1 or  a[1][0] == a[1][1] == a[1][2] == -1 or  a[2][0] == a[2][1] == a[2][2] == -1 or  a[0][0] == a[1][0] == a[2][0] == -1 or  a[0][1] == a[1][1] == a[2][1] == -1 or  a[0][2] == a[1][2] == a[2][2] == -1 or  a[0][0] == a[1][1] == a[2][2] == -1 or  a[0][2] == a[1][1] == a[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):
import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

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


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1
print(a)
if c!=0:
    print("Yes")
else:
    print("No")


import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
c=0

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


if a[0][0]==a[1][1]==a[2][2]="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]="x":
        c+=1

if c!=0:
    print("Yes")
else:
    print("No")


import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

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


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1
    if a[z]][0]==a[z][1]==a[z][1s]=="x":
        c+=1
if c!=0:
    print("Yes")
else:
    print("No")


import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

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


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1
    if a[z][0]==a[z][1]==a[z][2]=="x":
        c+=1
if c!=0:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
def solve():
    card = []
    num_pos = {}
    for i in range(3):
        row = [int(num) for num in input().split()]
        card.append(row)
        for j,num in enumerate(row):
            num_pos[num] = (i,j)

    N = int(input())
    for i in range(N):
        target = int(input())
        # print(int(input()))
        if target in num_pos:
            pos_i, pos_j = num_pos[target]
            card[pos_i][pos_j] = 0

    ans = False
    for row in card:
        if not any(row):
            ans = True
    for column in range(3):
        column_flag = True
        for i in range(3):
            if card[i][column]:
                column_flag = False
        if column_flag:
            ans = True
    for i in range(3):
        diagonal_flag = True
        if card[i][i]:
            diagonal_flag = False
        if diagonal_flag:
            ans = True
    for i in range(3):
        diagonal_flag = True
        if card[2-i][i]:
            diagonal_flag = False
        if diagonal_flag:
            ans = True
    if ans:
        print("Yes")
    else:
        print("No")

    print(card)

if __name__ == "__main__":
    solve()

def solve():
    card = []
    num_pos = {}
    for i in range(3):
        row = [int(num) for num in input().split()]
        card.append(row)
        for j,num in enumerate(row):
            num_pos[num] = (i,j)

    N = int(input())
    for i in range(N):
        target = int(input())
        # print(int(input()))
        if target in num_pos:
            pos_i, pos_j = num_pos[target]
            card[pos_i][pos_j] = 0

    ans = False
    for row in card:
        if not any(row):
            ans = True
    for column in range(3):
        column_flag = True
        for i in range(3):
            if card[i][column]:
                column_flag = False
        if column_flag:
            ans = True
    diagonal_flag = True
    for i in range(3):
        if card[i][i]:
            diagonal_flag = False
    if diagonal_flag:
        ans = True
    diagonal_flag = True
    for i in range(3):
        if card[2-i][i]:
            diagonal_flag = False
    if diagonal_flag:
        ans = True
    if ans:
        print("Yes")
    else:
        print("No")
    # for row in card:
    #     print(row)

if __name__ == "__main__":
    solve()

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):
from sys import stdin,exit
import  numpy as np
A = [stdin.readline().rstrip().split() for _ in range(3)]
sum(A,[])
n = int(stdin.readline().rstrip())
B= [stdin.readline().rstrip().split() for _ in range(n)]
if len(B)<=2:
    print("No")
    sys.exit()
for i in range(len(B)):
    try:
        A[A.index(B[i])]=0
    except:
        continue
if A[1]+A[2]+A[3]==0 or A[1]+A[4]+A[7]==0 or A[3]+A[5]+A[7]==0 or A[4]+A[5]+A[6]==0 or A[2]+A[5]+A[8]==0 or A[1]+A[5]+A[9]==0 or A[7]+A[8]+A[9]==0 or A[3]+A[6]+A[9]==0:
    print("Yes")
else:
    print("No")

from sys import stdin,exit
import  numpy as np
A = [stdin.readline().rstrip().split() for _ in range(3)]
A=sum(A,[])
n = int(stdin.readline().rstrip())
B= [stdin.readline().rstrip().split() for _ in range(n)]
B=sum(B,[])
if len(B)<=2:
    print("No")
    sys.exit()
for i in range(len(B)):
    try:
        A[A.index(B[i])]=0
    except:
        continue    
if A[1]+A[2]+A[0]==0 or A[0]+A[3]+A[6]==0 or A[2]+A[4]+A[6]==0 or A[3]+A[4]+A[5]==0 or A[1]+A[4]+A[7]==0 or A[0]+A[4]+A[8]==0 or A[6]+A[7]+A[8]==0 or A[2]+A[5]+A[8]==0:
    print("Yes")
else:
    print("No")

from sys import stdin,exit
import  numpy as np
A = [stdin.readline().rstrip().split() for _ in range(3)]
A=sum(A,[])
n = int(stdin.readline().rstrip())
B= [stdin.readline().rstrip().split() for _ in range(n)]
B=sum(B,[])
if len(B)<=2:
    print("No")
    sys.exit()
for i in range(len(B)):
    try:
        A[A.index(B[i])]=0
    except:
        continue
A=[int(i) for i in A]
if A[1]+A[2]+A[0]==0 or A[0]+A[3]+A[6]==0 or A[2]+A[4]+A[6]==0 or A[3]+A[4]+A[5]==0 or A[1]+A[4]+A[7]==0 or A[0]+A[4]+A[8]==0 or A[6]+A[7]+A[8]==0 or A[2]+A[5]+A[8]==0:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
x=[list(map(str,input().split())) for _ in range(3)]
N=int(input())
B=[input() for _ in range(N)]
flag=0
for i in range(3):
  for j in range(3):
    if x[i][j] in B:
      x[i][j]=True

for p in range(3):
  if x[p].count(True)==3:
    flag=1
lis=[]
lis2=[]
for a in range(3):
  for b in range(3):
    lis2.append(x[b][a])
  else:
    lis.append(lis2)
    lis2=[]

for q in range(3):
  if lis[q].count(True)==3:
    flag=1
if flag==1:
  print("Yes")
else:
  print("No")

x=[list(map(str,input().split())) for _ in range(3)]
N=int(input())
B=[input() for _ in range(N)]
flag=0
for i in range(3):
  for j in range(3):
    if x[i][j] in B:
      x[i][j]=True

for p in range(3):
  if x[p].count(True)==3:
    flag=1
lis=[]
lis2=[]
for a in range(3):
  for b in range(3):
    lis2.append(x[b][a])
  else:
    lis.append(lis2)
    lis2=[]

for q in range(3):
  if lis[q].count(True)==3:
    flag=1
if x[0][0]==True and x[1][1]==True and x[2][2]==True:
  flag=1
elif if x[0][2]==True and x[1][1]==True and x[2][0]==True:
if flag==1:
  print("Yes")
else:
  print("No")

x=[list(map(str,input().split())) for _ in range(3)]
N=int(input())
B=[input() for _ in range(N)]
flag=0
for i in range(3):
  for j in range(3):
    if x[i][j] in B:
      x[i][j]=True

for p in range(3):
  if x[p].count(True)==3:
    flag=1
lis=[]
lis2=[]
for a in range(3):
  for b in range(3):
    lis2.append(x[b][a])
  else:
    lis.append(lis2)
    lis2=[]

for q in range(3):
  if lis[q].count(True)==3:
    flag=1
if x[0][0]==True and x[1][1]==True and x[2][2]==True:
  flag=1
elif  x[0][2]==True and x[1][1]==True and x[2][0]==True:
  flag=1
if flag==1:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Runtime Error

Accepted