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()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
n = int(input())
for i in range(1,n+1):
  b_i = int(input())
for j in range(1,n+1):
  d = [" " if b_j in s else s for s in a]
  e = [" " if b_j in s else s for s in b]
  f = [" " if b_j in s else s for s in c]
if d[0]==d[1]==d[2] or e[0]==e[1]==e[2] or f[0]==f[1]==f[2] or d[0]==e[0]==f[0] or d[1]==e[1]==f[1] or d[2]==e[2]==f[2] or d[0]==e[1]==f[2] or d[2]==e[1]==f[0]:
  print('Yes')
else:
  print('No')

a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for i in range(3):
    for j in range(3):
      for k in range(3):
        if a[i][j] == b[k]:
            a[i][j] = 0
ans = 'No'
for i in range(3):
    if a[i][0]+a[i][1]+a[i][2] == 0:
        ans = 'Yes'
    if a[0][i]+a[1][i]+a[2][i] == 0:
        ans = 'Yes'
if a[0][0]+a[1][1]+a[2][2] == 0 or a[2][0]+a[1][1]+a[0][2] == 0:
    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)]
for i in range(3):
  for j in range(3):
    for k in range(3):
      if a[i][j] == b[k]:
          a[i][j] = 0
ans = 'No'
for i in range(3):
  if a[i][0]+a[i][1]+a[i][2] == 0:
      ans = 'Yes'
  if a[0][i]+a[1][i]+a[2][i] == 0:
      ans = 'Yes'
if a[0][0]+a[1][1]+a[2][2] == 0 or a[2][0]+a[1][1]+a[0][2] == 0:
    ans = 'Yes'
print(ans)


a = list(map(str,input().split()))
b = list(map(str,input().split()))
c = list(map(str,input().split()))
n = int(input())
for i in range(1,n+1):
  b_i = int(input())
  
for i in range(1,n+1):
  d = [" " if 'b_i' in s else s for s in a]
  e = [" " if 'b_i' in s else s for s in b]
  f = [" " if 'b_i' in s else s for s in c]
if d[0]==d[1]==d[2] or e[0]==e[1]==e[2] or f[0]==f[1]==f[2] or d[0]==e[0]==f[0] or d[1]==e[1]==f[1] or d[2]==e[2]==f[2] or d[0]==e[1]==f[2] or d[2]==e[1]==f[0]:
  print('Yes')
else:
  print('No')

a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for i in range(3):
  for j in range(3):
    for k in range(3):
      if a[i][j] == b[k]:
        a[i][j] = 0
ans = 'No'
for i in range(3):
  if a[i][0]+a[i][1]+a[i][2] == 0:
    ans = 'Yes'
  if a[0][i]+a[1][i]+a[2][i] == 0:
    ans = 'Yes'
if a[0][0]+a[1][1]+a[2][2] == 0 or a[2][0]+a[1][1]+a[0][2] == 0:
  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)]
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
ans = 'No'
for i in range(3):
  if a[i][0]+a[i][1]+a[i][2] == 0:
    ans = 'Yes'
  if a[0][i]+a[1][i]+a[2][i] == 0:
    ans = 'Yes'
if a[0][0]+a[1][1]+a[2][2] == 0 or a[2][0]+a[1][1]+a[0][2] == 0:
  ans = 'Yes'
print(ans)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted