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):
Array = [list(map(int,input().split())) for _ in range(3)]
ArrayBingo = [[0,0,0],[0,0,0,],[0,0,0]]
N = int(input())
B = []
checkR = 0
checkG = 0
checkN = 0
for i in range (N):
    B.append(int(input()))
for l in range (N):
    for j in range (3):
        for k in range (3):
            if Array[j][k]==B[l]:
                ArrayBingo[j][k]=1
for i in range (3): 
    if (ArrayBingo[i][0] == 1):
        checkR+=1
if checkG ==3:
    print(Yes)
checkR=0
for i in range (3): 
    if (ArrayBingo[i][1] == 1):
        checkR+=1
if checkG ==3:
    print(Yes)
checkR=0
for i in range (3): 
    if (ArrayBingo[i][2] == 1):
        checkR+=1
if checkG ==3:
    print(Yes)
    else:
        checkR=0
for j in range (3):
    if (ArrayBingo[0][j] == 1):
        checkG+=1
if checkG ==3:
    print(Yes)
checkG=0
for j in range (3):
    if (ArrayBingo[1][j] == 1):
        checkG+=1
if checkG ==3:
    print(Yes)
checkG=0
for j in range (3):    
    if (ArrayBingo[2][j] == 1):
        checkG+=1
if checkG ==3:
    print(Yes)
    else:
        checkG=0
if (ArrayBingo[0][0] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][2] == 1) or (ArrayBingo[0][2] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][0] == 1):
    checkN = 1
else:
    checkN = 0
if checkN == 1:
    print('Yes')
else:
    print('No')

Array = [list(map(int,input().split())) for _ in range(3)]
ArrayBingo = [[0,0,0],[0,0,0,],[0,0,0]]
N = int(input())
B = []
checkR = 0
checkG = 0
checkN = 0
for i in range (N):
    B.append(int(input()))
    print(B)
for l in range (N):
    for j in range (3):
        for k in range (3):
            if Array[j][k]==B[l]:
                ArrayBingo[j][k]=1
for i in range (3): 
    if ArrayBingo[i][0] == 1 and ArrayBingo[i][1] == 1 and ArrayBingo[i][2] == 1:
        checkR=1
    else:
        checkR=0
for i in range (3):
    if ArrayBingo[0][i]== 1 and ArrayBingo[1][i] ==1 and ArrayBingo[2][i] == 1:
        checkG=1
    else:
        checkG=0
if (ArrayBingo[0][0] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][2] == 1) or (ArrayBingo[0][2] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][0] == 1):
    checkN = 1
else:
    checkN = 0
if checkR==1 or checkG == 1 or checkN == 1:
    print('Yes')
else:
    print('No')

Array = [list(map(str,input().split())) for _ in range(3)]
ArrayBingo = [[0,0,0][0,0,0,][0,0,0]]
N = int(input())
B = []
checkR = 0
checkG = 0
checkN = 0
for i in range (N):
    B.append(int(input()))
for j in range (3):
    for k in range (3):
        for l in range (N):
            if Array[j][k]==B[l]:
                ArrayBingo[j][k]=1
for i in range (3): 
    if [line[i] for line in ArrayBingo] != [1,1,1]:
        checkR=0
    else:
        checkR=1
for i in range (3):
    if [row[i] for row in ArrayBingo] != [1,1,1]:
        checkG=0
    else:
        checkG=1
if (ArrayBingo[1][1] == 1 and ArrayBingo[2][2] == 1 and ArrayBingo [3][3] == 1) or (ArrayBingo[1][3] == 1 and ArrayBingo[2][2] == 1 and ArrayBingo [3][1] == 1):
    checkN = 1
else:
    checkN = 0
if checkR==1 or checkG == 1 or checkN == 1:
    print(Yes)
else:
    print(No)


Array = [list(map(int,input().split())) for _ in range(3)]
ArrayBingo = [[0,0,0],[0,0,0,],[0,0,0]]
N = int(input())
B = []
checkR = 0
checkG = 0
checkN = 0
for i in range (N):
    B.append(int(input()))
for l in range (N):
    for j in range (3):
        for k in range (3):
            if Array[j][k]==B[l]:
                ArrayBingo[j][k]=1
for i in range (3): 
    if (ArrayBingo[i][0] == 1):
        checkR+=1
if checkR ==3:
    print('Yes')
    checkR=4
    if checkR !=4:
        checkR=0
for i in range (3): 
    if (ArrayBingo[i][1] == 1):
        checkR+=1
if checkR ==3:
    print('Yes')
    checkR=4
if checkR!=4:    
    checkR=0
for i in range (3): 
    if (ArrayBingo[i][2] == 1):
        checkR+=1
if checkR ==3:
    print('Yes')
    checkR =4
else:
    checkR=0
for j in range (3):
    if (ArrayBingo[0][j] == 1):
        checkG+=1
if checkG ==3:
    print('Yes')
    checkG =4
if checkG !=4:
    checkG=0
for j in range (3):
    if (ArrayBingo[1][j] == 1):
        checkG+=1
if checkG ==3:
    print('Yes')
    checkG =4
if checkG !=4:
    checkG=0
for j in range (3):    
    if (ArrayBingo[2][j] == 1):
        checkG+=1
if checkG ==3:
    print('Yes')
    checkG =4
else:
    checkG=0
if (ArrayBingo[0][0] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][2] == 1) or (ArrayBingo[0][2] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][0] == 1):
    checkN = 1
else:
    checkN = 0
if checkR != 4 and checkG !=4 and checkN==1:
    print('Yes')
if checkR == 0 and checkG ==0 and checkN==0:
    print('No')


Array = [list(map(int,input().split())) for _ in range(3)]
ArrayBingo = [[0,0,0],[0,0,0,],[0,0,0]]
N = int(input())
B = []
checkR = 0
checkG = 0
checkN = 0
for i in range (N):
    B.append(int(input()))
for l in range (N):
    for j in range (3):
        for k in range (3):
            if Array[j][k]==B[l]:
                ArrayBingo[j][k]=1
i=0
for i in range (3): 
    if ArrayBingo[i][0] == 1 and ArrayBingo[i][1] == 1 and ArrayBingo[i][2] == 1:
        checkR=1
    else:
        checkR=0
j=0
for j in range (3):
    if ArrayBingo[0][j] == 1 and ArrayBingo[1][j] == 1 and ArrayBingo[2][j] == 1:
        checkG=1
    else:
        checkG=0
if (ArrayBingo[0][0] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][2] == 1) or (ArrayBingo[0][2] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][0] == 1):
    checkN = 1
else:
    checkN = 0
if checkR==1:
    print('Yes')
    break
elif checkG == 1:
    print('Yes')
    break
elif checkN == 1:
    print('Yes')
    break
else:
    print('No')

Array = [list(map(int,input().split())) for _ in range(3)]
ArrayBingo = [[0,0,0],[0,0,0,],[0,0,0]]
N = int(input())
B = []
checkR = 0
checkG = 0
checkN = 0
for i in range (N):
    B.append(int(input()))
for l in range (N):
    for j in range (3):
        for k in range (3):
            if Array[j][k]==B[l]:
                ArrayBingo[j][k]=1
for i in range (3): 
    if (ArrayBingo[i][0] == 1):
        checkR+=1
if checkR ==3:
    print('Yes')
    checkR=4
    if checkR !=4:
        checkR=0
for i in range (3): 
    if (ArrayBingo[i][1] == 1):
        checkR+=1
if checkR ==3:
    print('Yes')
    checkR=4
if checkR!=4    
    checkR=0
for i in range (3): 
    if (ArrayBingo[i][2] == 1):
        checkR+=1
if checkR ==3:
    print('Yes')
    checkR =4
else:
    checkR=0
for j in range (3):
    if (ArrayBingo[0][j] == 1):
        checkG+=1
if checkG ==3:
    print('Yes')
    checkG =4
if checkG !=4:
    checkG=0
for j in range (3):
    if (ArrayBingo[1][j] == 1):
        checkG+=1
if checkG ==3:
    print('Yes')
    checkG =4
if checkG !=4:
    checkG=0
for j in range (3):    
    if (ArrayBingo[2][j] == 1):
        checkG+=1
if checkG ==3:
    print('Yes')
    checkG =4
else:
    checkG=0
if (ArrayBingo[0][0] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][2] == 1) or (ArrayBingo[0][2] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][0] == 1):
    checkN = 1
else:
    checkN = 0
if checkR != 4 and checkG !=4 and checkN==1:
    print('Yes')
if checkR == 0 and checkG ==0 and checkN==0:
    print('No')


A = []
A_1 = list(map(int,input().split()))
A_2 = list(map(int,input().split()))
A_3 = list(map(int,input().split()))
A.append(A_1)
A.append(A_2)
A.append(A_3)
B = []
check=0
BingocountR=0
BingocountG=0
N = int(input())
ArrayBingo =[[0,0,0],[0,0,0],[0,0,0]]
for i in range(N):
    B.append(int(input()))
for j in range (3):
    for k in range (3):
        for l in range (N):
            if A[j][k]==B[l]:
                ArrayBingo[j][k]=1
for i in range(3):
    for j in range(3):
        if ArrayBingo[j][i]==1:
            BingocountR+=1
            if BingocountR ==3:
                check+=1
    BingocountR = 0
for i in range(3):
    for j in range(3):
        if ArrayBingo[i][j]==1:
            BingocountG+=1
            if BingocountG ==3:
                check+=1
    BingocountG = 0
if (ArrayBingo[0][0] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][2] == 1) or (ArrayBingo[0][2] == 1 and ArrayBingo[1][1] == 1 and ArrayBingo [2][0] == 1):
    check += 1
if check>0:
    print('Yes')
else:
    print('No')
    

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted