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 = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
  else:
    print("No")
 

import sys
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
    sys.exit()
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
    sys.exit()
  else:
    print("No")
    sys.exit()
print("No")

import sys
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0

ANS = 0
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
    sys.exit()
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
    sys.exit()
  else:
    print("No")
    sys.exit()
print("No")

import sys
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
    sys.exit()
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
    sys.exit()
print("No")


import sys
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
    sys.exit()
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
    sys.exit()
  else:
    print("No")
    sys.exit()
 

bingo = [[],[],[]]

for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
if N < 9:
  print("No")
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0

for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0

for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
  ANS = 0

if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yse")
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yse")
 

print("No")

import sys
bingo = [[],[],[]]
 
for i in range(3):
  a, b, c = map(int,input().split())
  bingo[i].append(a)
  bingo[i].append(b)
  bingo[i].append(c)
  
N = int(input())
  
for i in range(N):
  S = int(input())
  for j in range(3):
    if S in bingo[j]:
      for k in range(3):
        if S == bingo[j][k]:
          bingo[j][k] = 'ok'
          
ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[i][j] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
for i in range(3):
  for j in range(3):
    if bingo[j][i] == 'ok':
      ANS += 1
      if ANS == 3:
        print("Yes")
        sys.exit()
  ANS = 0
 
if bingo[1][1] == 'ok':
  if bingo[0][0] == 'ok' and bingo[2][2] == 'ok':
    print("Yes")
    sys.exit()
  elif bingo[0][2] == 'ok' and bingo[2][0] == 'ok':
    print("Yes")
    sys.exit()
  else:
    print("No")
    sys.exit()
print("No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted