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

Submission attempts (in order):
a=[]
for i in range(3):
  a.append(list(map(int,input().split())))
n = int(input())
x = 0

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

print(a)

if (a[0][0] == 0 and a[2][2] == 0 and a[1][1] == 0) or (a[0][2] == 0 and a[2][0] == 0 and a[1][1] == 0): 
  print("Yes")
  x = 1
for i in range(3):
  if a[i][0] == 0 and a[i][1] == 0 and a[i][2] and x == 0: 
    print("Yes")
    x = 1
    break
  elif a[0][i] == 0 and a[1][i] == 0 and a[2][i] and x == 0: 
    print("Yes")
    x = 1
    break
if x == 0:
  print("No")a=[]
for i in range(3):
  a.append(list(map(int,input().split())))
n = int(input())
x = 0

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

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

import itertools

A=[]
for i in range(3):
    try:
        A.append(list(map(int,input().split())))
    except:
        break;
A = list(itertools.chain.from_iterable(A))
n = int(input())
b=[int(input()) for i in range(n)]

for i in b:
    if i in A:
        
#print(A)
#print(b)

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

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

print(a)

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

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

Submission attempts (in order):
mat = [[map(int,input().split())] for i in range(3)]
mat = mat[0]+mat[1]+mat[2]

n = int(input())
for _ in range(n):
  m = int(input())
  for i in range(9):
    if mat[i] == m:
      mat[i] = 1000

if sum(mat[:3])>=3000:
  print("Yes")
elif sum(mat[3:6])>=3000:
  print("Yes")
elif sum(mat[6:])>=3000:
  print("Yes")
elif sum(mat[::3])>=3000:
  print("Yes")
elif sum(mat[1::3])>=3000:
  print("Yes")
elif sum(mat[2::3])>=3000:
  print("Yes")
elif sum(mat[::4])>=3000:
  print("Yes")
elif sum(mat[2:7:2])>=3000:
  print("Yes")
else:
  print("No")

mat = [list(map(int,input().split())) for i in range(3)]
mat = mat[0]+mat[1]+mat[2]

n = int(input())
for _ in range(n):
  m = int(input())
  for i in range(9):
    if mat[i] == m:
      mat[i] = 1000

if sum(mat[:3])>=3000:
  print("Yes")
elif sum(mat[3:6])>=3000:
  print("Yes")
elif sum(mat[6:])>=3000:
  print("Yes")
elif sum(mat[::3])>=3000:
  print("Yes")
elif sum(mat[1::3])>=3000:
  print("Yes")
elif sum(mat[2::3])>=3000:
  print("Yes")
elif sum(mat[::4])>=3000:
  print("Yes")
elif sum(mat[2:7:2])>=3000:
  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()))

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b in al:
        al[al.index()] = 0
if a1[0] + a1[1] + a1[2] == 0 or a2[0] + a2[1] + a2[2] == 0 or a3[0] + a3[1] + a3[2] == 0 or a1[0] + a2[0] + a3[0] == 0 or a1[1] + a2[1] + a3[1] == 0 or a1[2] + a2[2] + a3[2] == 0 or a1[0] + a2[1] + a3[2] == 0 or a1[2] + a2[1] + a3[0] == 0:
    print("Yes")
else:
    print("No")


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

al = a1+a2+a3
n =int(input())

for i in range(n):
    b = int(input())
    if b == al:
        al[al.index()] = 0
if a1[0] + a1[1] + a1[2] == 0 or a2[0] + a2[1] + a2[2] == 0 or a3[0] + a3[1] + a3[2] == 0 or a1[0] + a2[0] + a3[0] == 0 or a1[1] + a2[1] + a3[1] == 0 or a1[2] + a2[2] + a3[2] == 0 or a1[0] + a2[1] + a3[2] == 0 or a1[2] + a2[1] + a3[0] == 0:
    print("Yes")
else:
    print("No")


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

al = a1+a2+a3
n =int(input())

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


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

al = a1+a2+a3
n =int(input())

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


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

al = a1+a2+a3
n =int(input())

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


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

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

Submission attempts (in order):
#Input
l_A =  [[0 for i in range(3)] for j in range(3)]

def detect_BINGO(l_Atf):
    #print(l_Atf)
    
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            
            return True
    
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            
            return True
    
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[3-1-i][3-1-i]
    if(f_detect):
        
        return True
    
    
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

#   print(l_Atf)
f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("no")


#Input
l_A =  [[0 for i in range(3)] for j in range(3)]
l_A[0] = list(map(int, input().split()))
l_A[1] = list(map(int, input().split()))
l_A[2] = list(map(int, input().split()))

def detect_BINGO(l_Atf):
    #print(l_Atf)
    
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            
            return True
    
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            
            return True
    
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][3-1-i]
    if(f_detect):
        
        return True
    
    
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

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

Submission attempts (in order):
# -*- coding: utf-8 -*-
# 157b
a = []
b = []
check_list = [False] * 9
for _ in range(3);
  a.extend(list(map(int, input().split())))
n = int(input())
for _ in range(n);
  b.append(int(input()))

for _b in b:
  if _b in a:
    check_list[a.index(_b)] = True

if check_list[0] and check_list[1] and check_list[2]\
  or check_list[3] and check_list[4] and check_list[5]\
  or check_list[6] and check_list[7] and check_list[8]\
  or check_list[0] and check_list[3] and check_list[6]\
  or check_list[1] and check_list[4] and check_list[7]\
  or check_list[2] and check_list[5] and check_list[8]\
  or check_list[0] and check_list[4] and check_list[8]\
  or check_list[2] and check_list[4] and check_list[6]:
  print('Yes')
else:
  print('No')



# -*- coding: utf-8 -*-
# 157b
a = []
b = []
check_list = [False] * 9
for _ in range(3):
  a.extend(list(map(int, input().split())))
n = int(input())
for _ in range(n):
  b.append(int(input()))

for _b in b:
  if _b in a:
    check_list[a.index(_b)] = True

if check_list[0] and check_list[1] and check_list[2]\
  or check_list[3] and check_list[4] and check_list[5]\
  or check_list[6] and check_list[7] and check_list[8]\
  or check_list[0] and check_list[3] and check_list[6]\
  or check_list[1] and check_list[4] and check_list[7]\
  or check_list[2] and check_list[5] and check_list[8]\
  or check_list[0] and check_list[4] and check_list[8]\
  or check_list[2] and check_list[4] and check_list[6]:
  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
card = []
for i in range(3):
  card.append(list(map(int, input().split())))
card = np.array(card)
n = int(input())
for k in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if (card[i, j] == b):
                card[i, j] = 0
flag = 0
for i in range(3):
  if (sum(card[i,:]) == 0):
    flag = 1
  if (sum(card[:,i]) == 0):
    flag = 1
if (card[0,0]+card[1,1]+card[2,2] == 0):
  flag = 1
if (card[0,2]+card[1,1]+card[2,0] == 0):
  flag = 1
if (flag == 1):
  print("yes")
else:
  print("no")

import numpy as np
card = []
for i in range(3):
  card.append(list(map(int, input().split())))
card = np.array(card)
n = int(input())
for k in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if (card[i, j] == b):
                card[i, j] = 0
flag = 0
for i in range(3):
  if (sum(card[i,:]) == 0):
    flag = 1
  if (sum(card[:,i]) == 0):
    flag = 1
if (card[0,0]+card[1,1]+card[2,2] == 0):
  flag = 1
if (card[0,2]+card[1,1]+card[2,0] == 0):
  flag = 1
if (flag == 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=[0]
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
print(a)
n=int(input())
for i in range(n):
    b=int(input())
    for k in range(10):
        if a[k]==b:
            a[k]=0
print(a)
t="No"
if a[1]==0 and a[2]==0 and a[3]==0:
    t="Yes"
if a[4]==0 and a[5]==0 and a[6]==0:
    t="Yes"
if a[7]==0 and a[8]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[4]==0 and a[7]==0:
    t="Yes"
if a[2]==0 and a[5]==0 and a[8]==0:
    t="Yes"
if a[3]==0 and a[6]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[5]==0 and a[9]==0:
    t="Yes"
if a[3]==0 and a[5]==0 and a[7]==0:
    t="Yes"

print(t)


a=[0]
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
a.extend(list(map(int,input().split())))
n=int(input())
for i in range(n):
    b=int(input())
    for k in range(10):
        if a[k]==b:
            a[k]=0
t="No"
if a[1]==0 and a[2]==0 and a[3]==0:
    t="Yes"
if a[4]==0 and a[5]==0 and a[6]==0:
    t="Yes"
if a[7]==0 and a[8]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[4]==0 and a[7]==0:
    t="Yes"
if a[2]==0 and a[5]==0 and a[8]==0:
    t="Yes"
if a[3]==0 and a[6]==0 and a[9]==0:
    t="Yes"
if a[1]==0 and a[5]==0 and a[9]==0:
    t="Yes"
if a[3]==0 and a[5]==0 and a[7]==0:
    t="Yes"

print(t)


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

N=int(input())

list1=[int(input()) for _ in range(N)]

list2=[]
i=0
while i<=2:
    j=0
    while j<=2:
        list2.append(num_list[i][j])
        j=j+1
    i=i+1

s=0
for k in list2:
    if list1.count(k)==1:
        list2[s]=101
        s=s+1
    else:
        s=s+1
        continue

print(list2)

if list2[0]+list2[1]+list2[2]==303:
    print('Yes')
elif list2[3]+list2[4]+list2[5]==303:
    print('Yes')
elif list2[6]+list2[7]+list2[8]==303:
    print('Yes')
elif list2[0]+list2[3]+list2[6]==303:
    print('Yes')
elif list2[1]+list2[4]+list2[7]==303:
    print('Yes')
elif list2[2]+list2[5]+list2[8]==303:
    print('Yes')
elif list2[0]+list2[4]+list2[8]==303:
    print('Yes')
elif list2[2]+list2[4]+list2[6]==303:
    print('Yes')
else:
    print('No')


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

N=int(input())

list1=[int(input()) for _ in range(N)]

list2=[]
i=0
while i<=2:
    j=0
    while j<=2:
        list2.append(num_list[i][j])
        j=j+1
    i=i+1

s=0
for k in list2:
    if list1.count(k)==1:
        list2[s]=101
        s=s+1
    else:
        s=s+1
        continue

if list2[0]+list2[1]+list2[2]==303:
    print('Yes')
elif list2[3]+list2[4]+list2[5]==303:
    print('Yes')
elif list2[6]+list2[7]+list2[8]==303:
    print('Yes')
elif list2[0]+list2[3]+list2[6]==303:
    print('Yes')
elif list2[1]+list2[4]+list2[7]==303:
    print('Yes')
elif list2[2]+list2[5]+list2[8]==303:
    print('Yes')
elif list2[0]+list2[4]+list2[8]==303:
    print('Yes')
elif list2[2]+list2[4]+list2[6]==303:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

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

Submission attempts (in order):
B=[];bingo=0
import numpy as np
A=np.zeros((3,3),dtype=int)
for i in range(3):
  a,b,c=map(int,input().split())
  A[i][0]=a
  A[i][1]=b
  A[i][2]=c
N=int(input())
for i in range(N):
  B.append(int(input()))
#print(A)

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 sum(A[i][:])==0:
    bingo=bingo+1
for i in range(3):
  if sum(A[0][i])==0 or sum(A[1][i])==0 or sum(A[2][i])==0:
    bingo=bingo+1
if A[0][0]+A[1][1]+A[2][2]==0:
  bingo=bingo+1
if A[2][0]+A[1][1]+A[0][2]==0:
  bingo=bingo+1
print("Yes" if bingo>=1 else "No")
print(sum(A[:][1]))
print(sum(A[1][:]))
print(bingo)

B=[];bingo=0
import numpy as np
A=np.zeros((3,3),dtype=int)
for i in range(3):
  a,b,c=map(int,input().split())
  A[i][0]=a
  A[i][1]=b
  A[i][2]=c
N=int(input())
for i in range(N):
  B.append(int(input()))
#print(A)

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 sum(A[i][:])==0:
    bingo=bingo+1
for i in range(3):
  if sum(A[0][i])==0 or sum(A[1][i])==0 or sum(A[2][i])==0:
    bingo=bingo+1
if A[0][0]+A[1][1]+A[2][2]==0:
  bingo=bingo+1
if A[2][0]+A[1][1]+A[0][2]==0:
  bingo=bingo+1
print("Yes" if bingo>=1 else "No")

B=[];bingo=0
import numpy as np
A=np.zeros((3,3),dtype=int)
for i in range(3):
  a,b,c=map(int,input().split())
  A[i][0]=a
  A[i][1]=b
  A[i][2]=c
N=int(input())
for i in range(N):
  B.append(int(input()))
#print(A)

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 sum(A[i][:])==0:
    bingo=bingo+1
for i in range(3):
  if A[0][i]+A[1][i]+A[2][i]==0:
    bingo=bingo+1
if A[0][0]+A[1][1]+A[2][2]==0:
  bingo=bingo+1
if A[2][0]+A[1][1]+A[0][2]==0:
  bingo=bingo+1
print("Yes" if bingo>=1 else "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):
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
a = [[0] * 3] * 3
x = [[0] * 3] * 3
for i in range(3):
    for j in range(3):
        a[i][j] = iin()
n = iin()
b = [0] * n
for i in range(n):
    b[i] = iin()

for i in range(3):
    for j in range(3):
        for f in range(3):
            if a[i][j] == b[f]:
                x[i][j] = 1
for i in range(3):
    if sum(x[i]) == 3:
        neko = neko + 1
    nya = x[0][i] + x[1][i] + x[2][i]
    if nya == 3:
        neko = neko + 1
nya = x[0][0]+ x[1][1] + x[2][2]
if nya == 3:
    neko = neko + 1
nya = x[0][2]+ x[1][1] + x[2][0]
if nya == 3:
    neko = neko + 1
if neko > 0:
    py()
else:
    pn()

import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
a = [] 
x = [[0] * 3 for i in range(3)]
for i in range(3):
    a.append([int(x) for x in input().split()])
n = iin()
b = [0] * n
for i in range(n):
    b[i] = iin()

for i in range(3):
    for j in range(3):
        for f in range(n):
            if a[i][j] == b[f]:
                x[i][j] = 1
print(x)
for i in range(3):
    if sum(x[i]) == 3:
        neko = neko + 1
    nya = x[0][i] + x[1][i] + x[2][i]
    if nya == 3:
        neko = neko + 1
nya = x[0][0]+ x[1][1] + x[2][2]
if nya == 3:
    neko = neko + 1
nya = x[0][2]+ x[1][1] + x[2][0]
if nya == 3:
    neko = neko + 1
if neko > 0:
    py()
else:
    pn()

import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
a = [] 
x = [[0] * 3 for i in range(3)]
for i in range(3):
    a.append([int(x) for x in input().split()])
n = iin()
b = [0] * n
for i in range(n):
    b[i] = iin()

for i in range(3):
    for j in range(3):
        for f in range(n):
            if a[i][j] == b[f]:
                x[i][j] = 1
for i in range(3):
    if sum(x[i]) == 3:
        neko = neko + 1
    nya = x[0][i] + x[1][i] + x[2][i]
    if nya == 3:
        neko = neko + 1
nya = x[0][0]+ x[1][1] + x[2][2]
if nya == 3:
    neko = neko + 1
nya = x[0][2]+ x[1][1] + x[2][0]
if nya == 3:
    neko = neko + 1
if neko > 0:
    py()
else:
    pn()

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
A = []
for i in range(3):
    A += list(map(int, input().split()))
N = int(input())
for i in range(N-1):
    b = int(input())
    if b in A:
        A = [0 if num == b else num for num in A]
    print(A)
bingo_check = [[0, 1, 2],
               [0, 3, 6],
               [0, 4, 8],
               [1, 4, 7],
               [2, 4, 6],
               [2, 5, 8],
               [3, 4, 5],
               [6, 7, 8]]
no_check = 1
for check in bingo_check:
    row = [A[i] for i in check]
    if not sum(row):
        print("Yes")
        no_check = 0
        break
if no_check:
    print("No")

A = []
for i in range(3):
    A += list(map(int, input().split()))
N = int(input())
for i in range(N):
    b = int(input())
    if b in A:
        A = [0 if num == b else num for num in A]
bingo_check = [[0, 1, 2],
               [0, 3, 6],
               [0, 4, 8],
               [1, 4, 7],
               [2, 4, 6],
               [2, 5, 8],
               [3, 4, 5],
               [6, 7, 8]]
no_check = 1
for check in bingo_check:
    row = [A[i] for i in check]
    if not sum(row):
        print("Yes")
        no_check = 0
        break
if no_check:
    print("No")

Verdicts: Wrong Answer

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

Submission attempts (in order):
def check(A,b):
    for raw in range(3):
        for colomn in range(3):
            if A[raw][colomn] == b:
                A[raw][colomn] = -1
                return
    return

A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
is_bingo = 'No'
for _ in range(N):
    b = int(input())
    check(A,b)

print(A)
for raw in range(3):
    if A[raw][0] + A[raw][1] + A[raw][2] == -3:
        is_bingo = 'Yes'

for colomn in range(3):
    if A[0][colomn] + A[1][colomn] + A[2][colomn] == -3:
        is_bingo = 'Yes'

if A[0][0] + A[1][1] + A[2][2] == -3:
    is_bingo = 'Yes'
if A[0][2] + A[1][1] + A[2][0] == -3:
    is_bingo = 'Yes'

print(is_bingo)

def check(A,b):
    for raw in range(3):
        for colomn in range(3):
            if A[raw][colomn] == b:
                A[raw][colomn] = -1
                return
    return

A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
is_bingo = 'No'
for _ in range(N):
    b = int(input())
    check(A,b)

for raw in range(3):
    if A[raw][0] + A[raw][1] + A[raw][2] == -3:
        is_bingo = 'Yes'

for colomn in range(3):
    if A[0][colomn] + A[1][colomn] + A[2][colomn] == -3:
        is_bingo = 'Yes'

if A[0][0] + A[1][1] + A[2][2] == -3:
    is_bingo = 'Yes'
if A[0][2] + A[1][1] + A[2][0] == -3:
    is_bingo = 'Yes'

print(is_bingo)

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=[]
A+=list(map(int, input().split()))
A+=list(map(int, input().split()))
A+=list(map(int, input().split()))
N=int(input())

b=[]
for _ in range(N):
    b.append(int(input()))

print(A, N, b)
find=set()
for num in b:
    if num in A:
        find.add(A.index(num))
print(find)
if {0, 3, 6} < find or {1, 4, 7} < find or {2, 5, 8} < find or {0, 1, 2} < find or {3, 4, 5} < find or {6, 7, 8} < find or {0, 4, 8} < find or {2, 4, 6} < find:
    print('Yes')
else:
    print('No')

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


BINGO=[{0,1,2}, {3,4,5}, {6,7,8}, {0,3,6}, {1,4,7}, {2,5,8}, {0,4,8}, {2,4,6}]

hole=set()
for num in b:
    for i in range(9):
        if num==A[i]:
            hole.add(i)

for tri in BINGO:

    if tri <= hole:
        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):
Ai_j = []
for i in range(3):
    Ai_j.append(list(map(int,input().split())))
N = int(input())
number_list = []
for i in range(N):
    number_list.append(int(input()))


for x in number_list:
    for i in range(3):
        for j in range(3):
           if  Ai_j[i][j] == x:
               Ai_j[i][j] = '○'


count = 0

if Ai_j[0][0] == Ai_j[0][2] == Ai_j[0][1] == '○': count+=1
if Ai_j[1][0] == Ai_j[1][2] == Ai_j[1][1] == '○': count+=1
if Ai_j[2][0] == Ai_j[2][2] == Ai_j[2][1] == '○': count+=1
if Ai_j[0][0] == Ai_j[1][0] == Ai_j[2][0] == '○': count+=1
if Ai_j[0][1] == Ai_j[1][1] == Ai_j[2][1] == '○': count+=1
if Ai_j[0][2] == Ai_j[1][2] == Ai_j[2][2] == '○': count+=1
if Ai_j[0][0] == Ai_j[1][1] == Ai_j[2][2] == '○': count+=1
if Ai_j[0][2] == Ai_j[1][1] == Ai_j[2][0] == '○': count+=1

if count == 0:
    print("Yes")
else:
    print("No")

Ai_j = []
for i in range(3):
    Ai_j.append(list(map(int,input().split())))
N = int(input())
number_list = []
for i in range(N):
    number_list.append(int(input()))
'''
print(Ai_j)
print(N)
print(number_list)
'''

for x in number_list:
    for i in range(3):
        for j in range(3):
           if  Ai_j[i][j] == x:
               Ai_j[i][j] = '○'
#print(Ai_j)

count = 0

if Ai_j[0][0] == Ai_j[0][2] == Ai_j[0][1] == '○': count+=1
if Ai_j[1][0] == Ai_j[1][2] == Ai_j[1][1] == '○': count+=1
if Ai_j[2][0] == Ai_j[2][2] == Ai_j[2][1] == '○': count+=1
if Ai_j[0][0] == Ai_j[1][0] == Ai_j[2][0] == '○': count+=1
if Ai_j[0][1] == Ai_j[1][1] == Ai_j[2][1] == '○': count+=1
if Ai_j[0][2] == Ai_j[1][2] == Ai_j[2][2] == '○': count+=1
if Ai_j[0][0] == Ai_j[1][1] == Ai_j[2][2] == '○': count+=1
if Ai_j[0][2] == Ai_j[1][1] == Ai_j[2][0] == '○': count+=1

if count == 0:
    print("No")
else:
    print("Yes")

Verdicts: Wrong Answer

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

Submission attempts (in order):
import numpy as np
A = np.array([list(map(int,input().split())) for i in range(3)])
N = int(input())
b = [int(input()) for i in range(N)]
B = np.array([[0]*3 for i in range(3)])
for _ in b:
    for t in range(3):
        for y in range(3):
            if A[t][y] == _:
                B[t][y] = 1
ans = "No"
for i in range(3):
    if all(A[i] == [1,1,1]):
        ans ="Yes"
    if all(A[:,i] == [1,1,1]):
        ans ="Yes"
if A[0,0] == 1 and A[1,1] == 1 and A[2,2] == 1:
    ans ="Yes"
if A[2,0] == 1 and A[1,1] == 1 and A[0,2] == 1:
    ans ="Yes"
print(ans)

import numpy as np
A = np.array([list(map(int,input().split())) for i in range(3)])
N = int(input())
b = [int(input()) for i in range(N)]
B = np.array([[0]*3 for i in range(3)])
for _ in b:
    for t in range(3):
        for y in range(3):
            if A[t][y] == _:
                B[t][y] = 1
ans = "No"
for i in range(3):
    if all(B[i] == [1,1,1]):
        ans ="Yes"
    if all(B[:,i] == [1,1,1]):
        ans ="Yes"
if B[0,0] == 1 and B[1,1] == 1 and B[2,2] == 1:
    ans ="Yes"
if B[2,0] == 1 and B[1,1] == 1 and B[0,2] == 1:
    ans ="Yes"
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):
inp = [int(x) for x in input().split()]

bingo = inp[0:9]
b = inp[10:]

for i in b:
    for j in range(len(bingo)):
            if i == bingo[j]:
                bingo[j] = 0

true_list = list()
for i in [0, 3, 6]:
    if (bingo[i] + bingo[i+1] + bingo[i+2]) == 0:
        true_list.append(0)
for i in [0, 1, 2]:
    if (bingo[i] + bingo[i+3] + bingo[i+6]) == 0:
        true_list.append(0)
if (bingo[0] + bingo[4] + bingo[8]) == 0:
    true_list.append(0)
if (bingo[2] + bingo[4] + bingo[6]) == 0:
    true_list.append(0)

if not all(true_list):
    print('Yes')
else:
    print('No')

# B problem
inp = [int(x) for x in input().rstrip('\n').split()]

bingo = inp[0:9]
b = inp[10:]

for i in b:
    for j in range(len(bingo)):
            if i == bingo[j]:
                bingo[j] = 0

true_list = list()
for i in [0, 3, 6]:
    if (bingo[i] + bingo[i+1] + bingo[i+2]) == 0:
        true_list.append(0)
for i in [0, 1, 2]:
    if (bingo[i] + bingo[i+3] + bingo[i+6]) == 0:
        true_list.append(0)
if (bingo[0] + bingo[4] + bingo[8]) == 0:
    true_list.append(0)
if (bingo[2] + bingo[4] + bingo[6]) == 0:
    true_list.append(0)

if not all(true_list):
    print('Yes')
else:
    print('No')

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

for i in range(N):
    b = int(input())
    for j in range(len(bingo)):
      for k in range(len(bingo[j])):
            if b == bingo[j][k]:
                bingo[j][k] = 0

for i in range(len(bingo)):
    if sum(bingo[i]) == 0:
        print('Yes')
        sys.exit()
    if (bingo[0][i] + bingo[1][i] + bingo[2][i]) == 0:
        print('Yes')
        sys.exit()

for i in [0]:
  if (bingo[i][i] + bingo[i+1][i+1] + bingo[i+2][i+2]) == 0:
    print('Yes')
    sys.exit()
  if (bingo[i][i+2] + bingo[i+1][i+1] + bingo[i+2][i]) == 0:
    print('Yes')
    sys.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):
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))
input3 = list(map(int, (input().split())))

a = input1 + input2 + input3

n = int(input())

b = []
for i in range(n):
    b.append(int(input()))

for s in b:
    for i in range(9):
        if a[i] == s:
            a[i] = 0

for i in range(3):
    if(a[i] + a[i+3] + a[i+6] == 0):
        print("YES")
        exit(0)

for i in range(0, 3, 3):
    if(a[i] + a[i+1] + a[i+2] == 0):
        print("YES")
        exit(0)

if(a[0] + a[4] + a[8] == 0):
    print("YES")
    exit(0)

if(a[2] + a[4] + a[6] == 0):
    print("YES")
    exit(0)

print("NO")


input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))
input3 = list(map(int, (input().split())))

a = input1 + input2 + input3

n = int(input())

b = []
for i in range(n):
    b.append(int(input()))

for s in b:
    for i in range(9):
        if a[i] == s:
            a[i] = 0

for i in range(3):
    if(a[i] + a[i+3] + a[i+6] == 0):
        print("Yes")
        exit(0)

for i in [0, 3, 6]:
    print(i)
    if(a[i] + a[i+1] + a[i+2] == 0):
        print("Yes")
        exit(0)

if(a[0] + a[4] + a[8] == 0):
    print("Yes")
    exit(0)

if(a[2] + a[4] + a[6] == 0):
    print("Yes")
    exit(0)

print("No")


input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))
input3 = list(map(int, (input().split())))

a = input1 + input2 + input3

n = int(input())

b = []
for i in range(n):
    b.append(int(input()))

for s in b:
    for i in range(9):
        if a[i] == s:
            a[i] = 0

for i in range(3):
    if(a[i] == a[i+3] and a[i] == a[i+6]):
        print("YES")
        exit(0)

for i in range(0, 3, 3):
    if(a[i] == a[i+1] and a[i] == a[i+2]):
        print("YES")
        exit(0)

if(a[0] == a[4] and a[i] == a[8]):
    print("YES")
    exit(0)

if(a[2] == a[4] and a[i] == a[6]):
    print("YES")
    exit(0)

print("NO")


input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))
input3 = list(map(int, (input().split())))

a = input1 + input2 + input3

n = int(input())

b = []
for i in range(n):
    b.append(int(input()))

# print(b)
for s in b:
    for i in range(9):
        if a[i] == s:
            a[i] = 0

for i in range(3):
    if(a[i] + a[i+3] + a[i+6] == 0):
        print("Yes")
        exit(0)

for i in [0, 3, 6]:
    # print(i)
    if(a[i] + a[i+1] + a[i+2] == 0):
        print("Yes")
        exit(0)

if(a[0] + a[4] + a[8] == 0):
    print("Yes")
    exit(0)

if(a[2] + a[4] + a[6] == 0):
    print("Yes")
    exit(0)

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

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

ans='No'

for i in range(3):
    for j in range(3):
        print(A[i][j])
        if A[i][j] in B:
            A[i][j]=-1

for i in range(3):
    if sum(A[i])==-3:
        ans='Yes'
    if A[0][i]+A[1][i]+A[2][i]==-3:
        ans='Yes'

if A[0][0]+A[1][1]+A[2][2]==-3:
    ans='Yes'

if A[0][2]+A[1][1]+A[2][0]==-3:
    ans='Yes'

print(ans)

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

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

ans='No'

for i in range(3):
    for j in range(3):
        if A[i][j] in B:
            A[i][j]=-1

for i in range(3):
    if sum(A[i])==-3:
        ans='Yes'
    if A[0][i]+A[1][i]+A[2][i]==-3:
        ans='Yes'

if A[0][0]+A[1][1]+A[2][2]==-3:
    ans='Yes'

if A[0][2]+A[1][1]+A[2][0]==-3:
    ans='Yes'

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

for i in range(3):
  n=0  
  for k in range(3):  
      if a[i][k]==0:
        n+=1
  if n==3:
    print("Yes")
    break
if n==0:
  for k in range(3):
    n=0  
    for i in range(3):  
      if a[i][k]==0:
        n+=1
    if n==3:
      print("Yes")
      break
if n==0:
  for i in range(3):  
      if a[i][i]==0:
        n+=1
  if n==3:
    print("Yes")
    
      
  if n==0:
    for i in range(3):
      if a[2-i][i]==0:
        n+=1
    if n==3:
      print("Yes")
    elif n==0:
      print("No")

a=[list(map(int,input().split())) for i in range(3)]
n=int(input())
b=[int(input()) for j in range(n)]
for j in range(n):
  for i in range(3):
    for k in range(3):
      if b[j] == a[i][k]:
        a[i][k]=0
x="yet"
sum=0
for i in range(3):
  sum+=a[i][i]
if sum==0:
  print("Yes")
  x="done"  

if x=="yet":
  sum=0
  for i in range(3):
    sum+=a[2-i][i]
  if sum==0:
    print("Yes")
    x="done"
    
if x=="yet":
  for i in range(3): 
    sum=0
    for k in range(3):  
      sum+=a[i][k]
    if sum==0:
      print("Yes")
      x="done"
      break

if x=="yet":
  for k in range(3): 
    sum=0
    for i in range(3):  
      sum+=a[i][k]
    if sum==0:
      print("Yes")
      x="done"
      break
if x=="yet":
      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 = []
for _ in range(N):
    b.append(input())

bingo1 =[0,0,0]
bingo2 =[0,0,0]
bingo3 =[0,0,0]
for i in range(3):
    for j in range(N):
        if A1[i]=b[j]:
            bingo1[i]+=1
        if A2[i]=b[j]:
            bingo2[i]+=1
        if A3[i]=b[j]:
            bingo3[i]+=1
if bingo1[0] == 1 and bingo1[1] == 1 and bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == 1 and bingo2[1] == 1 and bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == 1 and bingo3[1] == 1 and bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == 1 and bingo2[0] == 1 and bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == 1 and bingo2[1] == 1 and bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == 1 and bingo2[2] == 1 and bingo3[2] == 1:
    print("Yes")
elif bingo1[1] == 1 and bingo2[2] == 1 and bingo3[3] == 1:
    print("Yes")
elif bingo1[3] == 1 and bingo2[2] == 1 and bingo3[1] == 1:
    print("Yes")
else:
    print("No")


A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
b = [(int(input())) for _ in range(N)]

bingo1 =[0,0,0]
bingo2 =[0,0,0]
bingo3 =[0,0,0]
for i in range(3):
    for j in range(N):
        if A1[i]==b[j]:
            bingo1[i]=1
        elif A2[i]==b[j]:
            bingo2[i]=1
        elif A3[i]==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):
A1 = input().split()
A2 = input().split()
A3 = input().split()

hit_example = [7,56,73,84,146,273,292,448]
b = 0
ans = "no"

N = int(input())
for i in range(N):
  x = int(input())
  if int(A1[0]) == x:
    b += 256
  elif int(A1[1]) == x:
    b += 128
  elif int(A1[2]) == x:
    b += 64
  elif int(A2[0]) == x:
    b += 32
  elif int(A2[1]) == x:
    b += 16
  elif int(A2[2]) == x:
    b += 8
  elif int(A3[0]) == x:
    b += 4
  elif int(A3[1]) == x:
    b += 2
  elif int(A3[2]) == x:
    b += 1

for val in hit_example:
  if val & b == val:
    ans = "yes"
    break
    
print(ans)

A1 = input().split()
A2 = input().split()
A3 = input().split()

hit_example = [7,56,73,84,146,273,292,448]
b = 0
ans = "No"

N = int(input())
for i in range(N):
  x = int(input())
  if int(A1[0]) == x:
    b += 256
  elif int(A1[1]) == x:
    b += 128
  elif int(A1[2]) == x:
    b += 64
  elif int(A2[0]) == x:
    b += 32
  elif int(A2[1]) == x:
    b += 16
  elif int(A2[2]) == x:
    b += 8
  elif int(A3[0]) == x:
    b += 4
  elif int(A3[1]) == x:
    b += 2
  elif int(A3[2]) == x:
    b += 1

for val in hit_example:
  if val & b == val:
    ans = "Yes"
    break
    
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 = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = [int(input()) for _ in range(10)]

c = [[0 for _ in range(3)] for _ in range(3)]
result = ""

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

for i in range(3):
    if c[i][0] == c[i][1] == c[i][2] == 1:
        result = "Yes"
        break
    elif c[0][i] == c[1][i] == c[2][i] == 1:
        result = "Yes"
        break

if c[0][0] == c[1][1] == c[2][2] == 1:
    result = "Yes"
elif c[0][2] == c[1][1] == c[2][0] == 1:
    result = "Yes"

if result == "":
    result ="No"

print(result)


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

c = [[0 for _ in range(3)] for _ in range(3)]
result = ""

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

for i in range(3):
    if c[i][0] == c[i][1] == c[i][2] == 1:
        result = "Yes"
        break
    elif c[0][i] == c[1][i] == c[2][i] == 1:
        result = "Yes"
        break

if c[0][0] == c[1][1] == c[2][2] == 1:
    result = "Yes"
elif c[0][2] == c[1][1] == c[2][0] == 1:
    result = "Yes"

if result is None:
    result ="No"

print(result)

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

c = [[0 for _ in range(3)] for _ in range(3)]
result = ""

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

for i in range(3):
    if c[i][0] == c[i][1] == c[i][2] == 1:
        result = "Yes"
        break
    elif c[0][i] == c[1][i] == c[2][i] == 1:
        result = "Yes"
        break

if c[0][0] == c[1][1] == c[2][2] == 1:
    result = "Yes"
elif c[0][2] == c[1][1] == c[2][0] == 1:
    result = "Yes"

if result == "":
    result ="No"

print(result)


Verdicts: Runtime Error

Runtime Error

Accepted