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

Submission attempts (in order):

A11,A12,A13 = input().split()
A21,A22,A23 = input().split()
A31,A32,A33 = input().split()

N = int(input())
a = list()

for i in range(N):
    a.append(input())
    if a[0+i] == A11:
        A11 = True
    elif a[0+i] == A12:
        A12 = True
    elif a[0+i] == A13:
        A13 = True
    elif a[0+i] == A21:
        A21 = True
    elif a[0+i] == A22:
        A22 = True
    elif a[0+i] == A23:
        A23 = True
    elif a[0+i] == A31:
        A31 = True
    elif a[0+i] == A32:
        A32 = True
    elif a[0+i] == A33:
        A33 = True


if A11 == True and A12 == True and A13 == True:
    print("yes")
elif A11 == True and A21 == True and A31 == True:
    print("yes")
elif A11 == True and A22 == True and A33 == True:
    print("yes")
elif A12 == True and A22 == True and A32 == True:
    print("yes")
elif A13 == True and A23 == True and A33 == True:
    print("yes")
elif A21 == True and A22 == True and A23 == True:
    print("yes")
elif A31 == True and A32 == True and A33 == True:
    print("yes")
elif A13 == True and A22 == True and A31 == True:
    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())
a = []

for i in range(N):
    a.append(int(input()))
   
    if A1[0] == a[i]:
        A1[0] = True
    elif a[i] == A1[1]:
        A1[1] = True
    elif a[i] == A1[2]:
        A1[2] = True
    elif a[i] == A2[0]:
        A2[0] = True
    elif a[i] == A2[1]:
        A2[1] = True
    elif a[i] == A2[2]:
        A2[2] = True
    elif a[i] == A3[0]:
        A3[0] = True
    elif a[i] == A3[1]:
        A3[1] = True
    elif a[i] == A3[2]:
        A3[2] = True


if A1[0] == True and A1[1] == True and A1[2] == True:
    print("yes")
elif A1[0] == True and A2[0] == True and A3[0] == True:
    print("yes")
elif A1[0] == True and A2[1] == True and A3[2] == True:
    print("yes")
elif A1[1] == True and A2[1] == True and A3[1] == True:
    print("yes")
elif A1[2] == True and A2[2] == True and A3[2] == True:
    print("yes")
elif A2[0] == True and A2[1] == True and A2[2] == True:
    print("yes")
elif A3[0] == True and A3[1] == True and A3[2] == True:
    print("yes")
elif A1[2] == True and A2[1] == True and A3[0] == True:
    print("Yes")
    
else:             
    print("No")


A11,A12,A13 = input().split()
A21,A22,A23 = input().split()
A31,A32,A33 = input().split()

N = int(input())
a = list()

for i in range(N):
    a.append(input())
    if a[0+i] == A11:
        A11 = True
    elif a[0+i] == A12:
        A12 = True
    elif a[0+i] == A13:
        A13 = True
    elif a[0+i] == A21:
        A21 = True
    elif a[0+i] == A22:
        A22 = True
    elif a[0+i] == A23:
        A23 = True
    elif a[0+i] == A31:
        A31 = True
    elif a[0+i] == A32:
        A32 = True
    elif a[0+i] == A33:
        A33 = True


if A11 == True and A12 == True and A13 == True:
    print("yes")
elif A11 == True and A21 == True and A31 == True:
    print("yes")
elif A11 == True and A22 == True and A33 == True:
    print("yes")
elif A12 == True and A22 == True and A32 == True:
    print("yes")
elif A13 == True and A23 == True and A33 == True:
    print("yes")
elif A21 == True and A22 == True and A23 == True:
    print("yes")
elif A31 == True and A32 == True and A33 == True:
    print("yes")
elif A13 == True and A22 == True and A31 == True:
    print("Yes")
    
else:             
    print("No")
    
    
    
    

# -*- coding: utf-8 -*-
"""
Created on Sun Aug  9 20:50:35 2020

@author: akros
"""

# -*- coding: utf-8 -*-
"""
Created on Sun Aug  9 16:51:42 2020

@author: akros
"""

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

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

for i in range(N):
    a.append(int(input()))
   
    if A1[0] == a[i]:
        A1[0] = True
    elif a[i] == A1[1]:
        A1[1] = True
    elif a[i] == A1[2]:
        A1[2] = True
    elif a[i] == A2[0]:
        A2[0] = True
    elif a[i] == A2[1]:
        A2[1] = True
    elif a[i] == A2[2]:
        A2[2] = True
    elif a[i] == A3[0]:
        A3[0] = True
    elif a[i] == A3[1]:
        A3[1] = True
    elif a[i] == A3[2]:
        A3[2] = True


if A1[0] == True and A1[1] == True and A1[2] == True:
    print("Yes")
elif A1[0] == True and A2[0] == True and A3[0] == True:
    print("Yes")
elif A1[0] == True and A2[1] == True and A3[2] == True:
    print("Yes")
elif A1[1] == True and A2[1] == True and A3[1] == True:
    print("Yes")
elif A1[2] == True and A2[2] == True and A3[2] == True:
    print("Yes")
elif A2[0] == True and A2[1] == True and A2[2] == True:
    print("Yes")
elif A3[0] == True and A3[1] == True and A3[2] == True:
    print("Yes")
elif A1[2] == True and A2[1] == True and A3[0] == True:
    print("Yes")
    
else:             
    print("No")

    
    
    


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted