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):
a1 = list(map(int,input().split()))
a2 =list(map(int,input().split()))
a3 =list(map(int,input().split()))
n = int(input())
b = []

for i in range(1,n + 1):
    bc = int(input())
    b.append(bc)

for i in range(n):
    for m in range(3):
        if a1[m] == b[i]:
            a1[m] = 0
        elif a2[m] == b[i]:
            a2[m] = 0
        elif a3[m] == b[i]:
            a3[m] = 0

for i in range(3):
    if a1[i] == 0 and a2[i] == 0 and a3[i] == 0:
        print('縦')
        exit()

if a1.count(0) == 3 or a2.count(0) ==3 or a3.count(0) == 3:
    print('横')
    exit()

if a2[2] == 0:
    if a1[1] == 0 and a3[3] == 0 or a3[1] ==0 and a1[3] == 0:
        print('斜め')
        exit()

print('No')

A = []
a1 = []
a2 = []
a3 = []
for i in range(3):
    a = list(map(int,input().split()))
    for K in range(3):
        A.append(a[K])


N = int(input())
for i in range(N):
    b = int(input())
    for k in range(9):
        if b == A[k]:
            A[k] = 0




for i in range(9):
    if 0 <= i <= 2:
        a1.append(A[i])
    elif 3 <= i <= 5:
        a2.append(A[i])
    else:
        a3.append(A[i])

x = 0
y = 0
z = 0
for i in range(3):
    if a1[i] == 0:
        x += 1
    if a2[i] == 0:
        y += 1
    if a3[i] == 0:
        z += 1

if x == 3 or y == 3 or z == 3:
    print('Yes')
    exit()

for i in range(3):
    if a1[i] == 0 and a2[i] == 0 and a3[i] == 0:
        print('Yes')
        exit()

if a2[1] == 0:
    if a1[0] == 0 and a3[2] == 0 or a1[2] == 0 and a3[0] == 0:
        print('Yes')
        exit()

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 sys
li = [list(map(int,input().split())) for i in range(3)]
n = int(input())
cnt = 0
for i in range(2):
    for j in range(2):
        for k in int(input()):
            if li[i][j] == k:
                li[i][j] == -1
            else:
                pass

for a in range(2):
    if li[a][0] == li[a][1] == li[a][2] == -1:
        print("Yes")
        sys.exit()
    else:
        pass
for b in range(2):
    if li[0][[b] == li[1][[b] == li[2][[b] == -1:
        print("Yes")
        sys.exit()
    else:
        pass
if li[0][[0] == li[1][[1] == li[2][[2] == -1:
    print("Yes")
    sys.exit()
else:
    pass
if li[0][[2] == li[1][[1] == li[2][[0] == -1:
    print("Yes")
    sys.exit()
else:
    print("No")

import sys
li = [list(map(int,input().split())) for i in range(3)]
n = int(input())
k = [int(input()) for i in range(n)]
cnt = 0
for i in range(3):
    for j in range(3):
        if li[i][j] in k:
            li[i][j] = -1
        else:
            pass
for a in range(3):
    if li[a][0] == li[a][1] == li[a][2] == -1:
        print("Yes")
        exit()
    else:
        pass
for b in range(3):
    if li[0][b] == li[1][b] == li[2][b] == -1:
        print("Yes")
        exit()
    else:
        pass
if li[0][0] == li[1][1] == li[2][2] == -1:
    print("Yes")
    exit()

elif li[0][2] == li[1][1] == li[2][0] == -1:
    print("Yes")
    exit()
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 sys

input = sys.stdin.readline

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

Q = int(input())
for i in range(Q):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                marked[j][k] = True

print(marked)

for i in range(3):
    if marked[i][0] == marked[i][1] == marked[i][2] == True:
        print("Yes")
        exit()
    if marked[0][i] == marked[1][i] == marked[2][i] == True:
        print("Yes")
        exit()
if marked[0][0] == marked[1][1] == marked[2][2] == True:
    print("Yes")
    exit()
if marked[0][2] == marked[1][1] == marked[2][0] == True:
    print("Yes")
    exit()
print("No")


import sys

input = sys.stdin.readline

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

Q = int(input())
for i in range(Q):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                marked[j][k] = True
                
for i in range(3):
    if marked[i][0] == marked[i][1] == marked[i][2] == True:
        print("Yes")
        exit()
    if marked[0][i] == marked[1][i] == marked[2][i] == True:
        print("Yes")
        exit()
if marked[0][0] == marked[1][1] == marked[2][2] == True:
    print("Yes")
    exit()
if marked[0][2] == marked[1][1] == marked[2][0] == True:
    print("Yes")
    exit()
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):
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(N):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 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):
a = [list(map(int, input().split())) for _ in range(3)]

n = int(input())

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

ok = True

for i in range(3):
    count = 0
    for j in range(3):
        count += a[i][j]
        if count != 0:
            ok = False
for i in range(3):
    count = 0
    for j in range(3):
        count += a[j][i]
        if count != 0:
            ok = False
count = 0
for i in range(3):
    count += a[i][i]
    if count != 0:
        ok = False
count = 0
for i in range(3):
    count += a[2-i][i]
    if count != 0:
        ok = False

print("Yes" if ok else "No")


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

n = int(input())

bingo = [[0] * 3 for _ in range(3)]

for _ in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                bingo[i][j] = 1

ok = False

for i in range(3):
    count = 0
    for j in range(3):
        count += bingo[i][j]
    if count == 3:
        ok = True
for i in range(3):
    count = 0
    for j in range(3):
        count += bingo[j][i]
    if count == 3:
        ok = True
count = 0
for i in range(3):
    count += bingo[i][i]
    if count == 3:
        ok = True
count = 0
for i in range(3):
    count += bingo[2-i][i]
    if count == 3:
        ok = True

print("Yes" if ok else "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):
import numpy as np

A = []
a = [int(x) for x in input().split()]
A.append(a)
A_len = len(a)
state = True

for s in range(A_len - 1):
    A.append([int(x) for x in input().split()])

A = np.array(A)

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




for i in range(N):
    B.append(int(input()))

for i in range(N):
    A = np.where(A==B[i], 0, A)


for i in range(A_len):
    if (A[i].sum() == 0) or (A[:,i].sum() == 0):
        print('Yes')
        exit()

    if (A[i,i] != 0) or (A[i,A_len-i-1] != 0):
        state = False

if state:
    print('Yes')
else:
    print('No')


import numpy as np

A = []
a = [int(x) for x in input().split()]
A.append(a)
A_len = len(a)
naname1 = 0
naname2 = 0

for s in range(A_len - 1):
    A.append([int(x) for x in input().split()])

A = np.array(A)

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




for i in range(N):
    B.append(int(input()))

for i in range(N):
    A = np.where(A==B[i], 0, A)


for i in range(A_len):
    if (A[i].sum() == 0) or (A[:,i].sum() == 0):
        print('Yes')
        exit()

for i in range(A_len):
    naname1 += A[i,i]
    naname2 += A[i,A_len-i-1]


if naname1==0 or naname2==0:
    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):
def main():
  a = []
  ans = "No"
  hit_examples = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
  for i in range(3):
    a.extend(list(map(int, input().split())))
  n = int(input())
  b = []
  for i in range(n):
    b.append(int(input()))
  for b_value in b:
    for i in range(len(a)):
      if b_value == a[i]:
        a[i] = -1

  for hit_example in hit_examples:
    cnt = 0
    for i in range(len(a)):
      if a[i] == -1 and i in hit_example:
        cnt += 1
      if cnt == 3:
        ans = "Yes"
        print(ans)
        return
  print(ans)

def main():
  a = []
  ans = "No"
  hit_examples = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
  for i in range(3):
    a.extend(list(map(int, input().split())))
  n = int(input())
  b = []
  for i in range(n):
    b.append(int(input()))
  for b_value in b:
    for i in range(len(a)):
      if b_value == a[i]:
        a[i] = -1
  
  for hit_example in hit_examples:
    for i in range(len(a)):
      if a[i] == -1 and i in hit_example:
        ans = "Yes"
        return
  print(ans)

if __name__ == '__main__':
  main()

a = []
ans = "No"
hit_examples = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
for i in range(3):
  a.extend(list(map(int, input().split())))
n = int(input())
b = []
for i in range(n):
  b.append(int(input()))
for b_value in b:
  for i in range(len(a)):
    if b_value == a[i]:
      a[i] = -1

for hit_example in hit_examples:
  for i in range(len(a)):
    print(i in hit_example, a[i] == -1)
    if a[i] == -1 and i in hit_example:
      ans = "Yes"
      break
    else:
      continue
  break
print(ans)

def main():
  a = []
  ans = "No"
  hit_examples = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
  for i in range(3):
    a.extend(list(map(int, input().split())))
  n = int(input())
  b = []
  for i in range(n):
    b.append(int(input()))
  for b_value in b:
    for i in range(len(a)):
      if b_value == a[i]:
        a[i] = -1

  for hit_example in hit_examples:
    cnt = 0
    for i in range(len(a)):
      if a[i] == -1 and i in hit_example:
        cnt += 1
      if cnt == 3:
        ans = "Yes"
        print(ans)
        return
  print(ans)

if __name__ == '__main__':
  main()

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 = []
for _ in range(3):
    A = list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]
for i in range(N):
    for j in range(9):
        if B[i] ==  A[j] :
            A[j] = 'a'
if A[0]==A[1]==A[2]=='a' or A[3]==A[4]==A[5]=='a' or A[6]==A[7]==A[8]=='a' or A[0]==A[3]==A[6]=='a' or A[1]==A[4]==A[7]=='a' or A[2]==A[5]==A[8]=='a' or  A[0]==A[4]==A[8]=='a' or A[2]==A[4]==A[6]=='a' :
    print('Yes')
else:
    print('No')

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

for i in range(0,N):
    for j in range(9):
        if B[i] ==  A[j]:
            A[j] = 0

if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or  A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0 :
    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):
a = []
for i in range(3):
  d, b, c = map(int, input().split())
  a.append(d)
  a.append(b)
  a.append(c)
for _ in range(int(input())):
  n = int(input())
  if(n in a):
    a[a.index(n)] = 0
retsu = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
frag = False
for i in range(8):
  frag1 = True
  for s in retsu[i]:
    if(a[s] > 0):
      frag1 = False
if(frag):
  print("Yes")
else:
  print("No")

a = []
for i in range(3):
  d, b, c = map(int, input().split())
  a.append(d)
  a.append(b)
  a.append(c)
for _ in range(int(input())):
  n = int(input())
  if(n in a):
    a[a.index(n)] = 0
retsu = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
frag = False
for i in range(8):
  frag1 = True
  for s in range(3):
    if(a[retsu[i][s]] > 0):
      frag1 = False
  frag = frag1 or frag
if(frag):
  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 = []
[A.extend(map(int, input().split())) for _ in range(3)]
_, *B = map(int, open(0).read().split())
for b in B:
    try:
        i = A.index(b)
        A[i] = 0
    except Exception:
        pass
lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
]
ans = "No"
for line in lines:
    a, b, c = line
    if A[a] == 0 and A[a] == A[b] and A[a] == A[c]:
        ans = "Yes"
print(ans)


A = []
[A.extend(map(int, input().split())) for _ in range(3)]
_, *B = map(int, open(0).read().split())
for b in B:
    try:
        i = A.index(b)
        A[i] = 0
    except:
        pass
lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
]
ans = "No"
for line in lines:
    a, b, c = line
    if A[a] == 0 and A[a] == A[b] and A[a] == A[c]:
        ans = "Yes"
print(ans)


A = []
[A.extend(map(int, input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]
for b in B:
    try:
        i = A.index(b)
        A[i] = 0
    except:
        pass
lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
]
ans = "No"
for line in lines:
    a, b, c = line
    if A[a] == 0 and A[a] == A[b] and A[a] == A[c]:
        ans = "Yes"
print(ans)


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):
i = list(map(int, input().split()))
j = [int(0)] * 9

n=i[9]

#print(j)

for b in range(9):
    for c in range(n):
        if i[b]==i[10+c]:
            j.insert(b,1)

#print(j)     

if  j[0]==1 and j[3]==1 and j[6]==1\
or j[1]==1 and j[4]==1 and j[7]==1\
or j[2]==1 and j[5]==1 and j[8]==1\
or j[0]==1 and j[1]==1 and j[2]==1\
or j[3]==1 and j[4]==1 and j[5]==1\
or j[6]==1 and j[7]==1 and j[8]==1\
or j[0]==1 and j[4]==1 and j[8]==1\
or j[2]==1 and j[4]==1 and j[6]==1:
    print('yes')
else:
    print('no')

i = list(map(int, input().split()))
j = [int(0)] * 9

n=i[9]

for b in range(9):
    for c in range(n):
        if i[b]==i[10+c]:
            j.insert(b,1)    

if  j[0]==1 and j[3]==1 and j[6]==1\
or j[1]==1 and j[4]==1 and j[7]==1\
or j[2]==1 and j[5]==1 and j[8]==1\
or j[0]==1 and j[1]==1 and j[2]==1\
or j[3]==1 and j[4]==1 and j[5]==1\
or j[6]==1 and j[7]==1 and j[8]==1\
or j[0]==1 and j[4]==1 and j[8]==1\
or j[2]==1 and j[4]==1 and j[6]==1:
    print('yes')
else:
    print('no')

i = list(map(int, input().split()))
j = [int(0)] * 9
 
n=i[9]
 
for b in range(9):
    for c in range(n):
        if i[b]==i[10+c]:
            j.insert(b,1)    
 
if  j[0]==1 and j[3]==1 and j[6]==1\
or j[1]==1 and j[4]==1 and j[7]==1\
or j[2]==1 and j[5]==1 and j[8]==1\
or j[0]==1 and j[1]==1 and j[2]==1\
or j[3]==1 and j[4]==1 and j[5]==1\
or j[6]==1 and j[7]==1 and j[8]==1\
or j[0]==1 and j[4]==1 and j[8]==1\
or j[2]==1 and j[4]==1 and j[6]==1:
    print('Yes')
else:
    print('No')

#import numpy as np

i=[input().split() for l in range(4)]

n=int(i[3][0])

j = [input() for i in range(n)]

#i=np.array(i)
#print(i)


k = [['0' for o in range(3)] for p in range(3)]

for b in range(3):
    #print('b:',b)
    for c in range(3):
        #print('c:',c)
        for d in range(n):
            #print('d:',d)
            if i[b][c]==j[d]:
                k[b][c]='1'
                
                
                
#print(i)
#print(j)
#print(k)


if  k[0][0]=='1' and k[0][1]=='1' and k[0][2]=='1'\
or k[1][0]=='1' and k[1][1]=='1' and k[1][2]=='1'\
or k[2][0]=='1' and k[2][1]=='1' and k[2][2]=='1'\
or k[0][0]=='1' and k[1][0]=='1' and k[2][0]=='1'\
or k[0][1]=='1' and k[1][1]=='1' and k[2][1]=='1'\
or k[0][2]=='1' and k[1][2]=='1' and k[2][2]=='1'\
or k[0][0]=='1' and k[1][1]=='1' and k[2][2]=='1'\
or k[2][0]=='1' and k[1][1]=='1' and k[0][2]=='1':
	print('Yes')
else:
    print('No')

Verdicts: Runtime Error

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

def x ():
    for i in range(3):
        if (appear[i][0] and appear[i][1] and appear[i][2] ):
            return "Yes"
    for i in range(3):
        if (appear[0][i] and appear[1][i] and appear[2][i]):
            return "Yes"
    if (appear[0][0] and appear[1][1] and appear[2][2]):
        return "Yes"
    if (appear[0][2] and appear[1][1] and appear[2][0]):
        return "Yes"
    return "No"
print(x())

a = list()
for i in range(3):
    a.append([int(x) for x in input().split()])
n = int(input())
b = list()
for i in range(n):
    b.append(int(input()))
appear = [[0,0,0],[0,0,0],[0,0,0]]
for i in range(3):
    for j in range(3):
        for k in b:
            if (a[i][j] == k):
                appear[i][j] = 1

def x ():
    for i in range(3):
        if (appear[i][0] and appear[i][1] and appear[i][2] ):
            return "Yes"
    for i in range(3):
        if (appear[0][i] and appear[1][i] and appear[2][i]):
            return "Yes"
    if (appear[0][0] and appear[1][1] and appear[2][2]):
        return "Yes"
    if (appear[0][2] and appear[1][1] and appear[2][0]):
        return "Yes"
    return "No"
print(x())

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

for i in range(N):
    for j in range(3):
        for l in range(3):
            if t[i] == s[j][l]
            s[j][l] = 0

if sum(s[0]) == 0 or sum(s[1]) == 0 or sum(s[2]) == 0 or s[0][0]+s[1][0]+s[2][0] == 0 or s[0][1]+s[1][1]+s[2][1] == 0 or s[0][2]+s[1][2]+s[2][2] == 0 or s[0][0]+s[1][1]+s[2][2] == 0 or s[2][0]+s[1][1]+s[0][2] == 0:
    print("Yes")
else:
    print("No")

s = []
for i in range(3):
    array = list(map(int,input().split()))
    s.append(array)
N = int(input())
t = [int(input()) for i in range(N)]
 
for i in range(N):
    for j in range(3):
        for l in range(3):
            if t[i] == s[j][l]:
                s[j][l] = 0
 
if sum(s[0]) == 0 or sum(s[1]) == 0 or sum(s[2]) == 0 or s[0][0]+s[1][0]+s[2][0] == 0 or s[0][1]+s[1][1]+s[2][1] == 0 or s[0][2]+s[1][2]+s[2][2] == 0 or s[0][0]+s[1][1]+s[2][2] == 0 or s[2][0]+s[1][1]+s[0][2] == 0:
    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):
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
x=[[0 for i in range(3)] for j in range(3)]
N=int(input())
if N>=3:
  for i in range(N):
    b=int(input())
    for j in range(3):
      if A[j]==b:
        x[0][j]=1
      elif B[j]==b:
        x[1][j]=1
      elif C[j]==b:
        x[2][j]=1
  flag=0
  if x[0][0]==1:
    if x[0][1]==1 and x[0][2]==1:
      flag=1
    elif x[1][0]==1 and x[2][0]==1:
      flag=1
    elif x[1][1]==1 and x[2][2]==1:
      flag=1
  elif x[1][1]==1:
    if x[0][1]==1 and x[2][1]==1:
      flag=1
    elif x[1][0]==1 and x[2][0]==1:
      flag=1
    elif x[0][2]==1 and x[2][0]==1:
      flag=1
  elif x[2][2]==1:
    if x[2][0]==1 and x[2][1]==1:
      flag=1
    elif x[0][2]==1 and x[1][2]==1:
      flag=1
  if flag==1:
    print("Yes")
  else:
    print("No")
  print(x)
else:
  print("No")

A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
x=[[0 for i in range(3)] for j in range(3)]
N=int(input())
if N>=3:
  for i in range(N):
    b=int(input())
    for j in range(3):
      if A[j]==b:
        x[0][j]=1
      elif B[j]==b:
        x[1][j]=1
      elif C[j]==b:
        x[2][j]=1
  flag=0
  if x[0][0]==1:
    if x[0][1]==1 and x[0][2]==1:
      flag=1
    if x[1][0]==1 and x[2][0]==1:
      flag=1
    if x[1][1]==1 and x[2][2]==1:
      flag=1
  if x[1][1]==1:
    if x[0][1]==1 and x[2][1]==1:
      flag=1
    if x[1][0]==1 and x[1][2]==1:
      flag=1
    if x[0][2]==1 and x[2][0]==1:
      flag=1
  if x[2][2]==1:
    if x[2][0]==1 and x[2][1]==1:
      flag=1
    if x[0][2]==1 and x[1][2]==1:
      flag=1
  if flag==1:
    print("Yes")
  else:
    print("No")
  #print(x)
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 =[]
for i in range(3):
    a.append(input().split())
print(a)
n = int(input())



for k in range(n):
    b = input()
    for i in range(3):
      for j in range(3):
        if(b in a[i][j]):
          a[i][j] = 'maru'
          #print('OK')
      

frag = False


for i in range(3):
     if((a[i][0] == 'maru') and (a[i][1] == 'maru')and(a[i][2] == 'maru')):
        frag = True

for i in range(3):
     if((a[0][i] == 'maru') and (a[1][i] == 'maru')and(a[2][i] == 'maru')):
        frag = True





if((a[0][0] == 'maru')and(a[1][1] == 'maru')and(a[2][2]=='maru')):
    frag = True
if((a[2][0] == 'maru')and(a[1][1] == 'maru')and(a[0][2]=='maru')):
    frag = True
        

if(frag == True):
    print('Yes')
else:
    print('No')




a =[]
for i in range(3):
    a.append(input().split())
print(a)
n = int(input())



for k in range(n):
    b = input()
    for i in range(3):
      for j in range(3):
        if(b in a[i][j]):
          a[i][j] = 'maru'
          #print('OK')
      

frag = False


for k in range(3):
    i = 0
    
    if((a[i][k] == 'maru') and (a[i+1][k] == 'maru')and(a[i+2][k] == 'maru')):
        frag = True


for k in range(3):
    j = 0
    
    if((a[k][j] == 'maru') and (a[k][j+1] == 'maru')and(a[k][j+2] == 'maru')):
        frag = True



if((a[0][0] == 'maru')and(a[1][1] == 'maru')and(a[2][2]=='maru')):
    frag = True

        

if(frag == True):
    print('Yes')
else:
    print('No')

a =[]
for i in range(3):
    a.append(input().split())
#print(a)
n = int(input())



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

#print(a)          

frag = False


for i in range(3):
     if((a[i][0] == 'maru') and (a[i][1] == 'maru')and(a[i][2] == 'maru')):
        frag = True

for i in range(3):
     if((a[0][i] == 'maru') and (a[1][i] == 'maru')and(a[2][i] == 'maru')):
        frag = True

if((a[0][0] == 'maru')and(a[1][1] == 'maru')and(a[2][2]=='maru')):
    frag = True
if((a[2][0] == 'maru')and(a[1][1] == 'maru')and(a[0][2]=='maru')):
    frag = True
        

if(frag == True):
    print('Yes')
else:
    print('No')






Verdicts: 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):
As = [list(map(int, input().split())) for x in range(3)]
N = int(input())
bs = [int(input()) for x in range(N)]


def create_bingo_card():
  result = [[0, 0, 0] for x in range(3)]
  i = 0
  while True:
    i2 = 0
    while True:
      if bs[i2] in As[i]:
        result[i][As[i].index(bs[i2])] += 1
      i2 += 1
      if i2 == len(bs):
        break
    i += 1
    if i == len(As):
      break
  return result


def solvd(bingo):
  tmp = [bingo[0][0], bingo[1][1], bingo[2][2]]
  if check1(tmp):
    print("Yes")
    return

  tmp = [bingo[0][2], bingo[1][1], bingo[2][0]]
  if check1(tmp):
    print("Yes")
    return

  r = 0
  for x in range(3):
    tmp = [bingo[0][x], bingo[1][x], bingo[2][x]]
    if check1(tmp):
      print("Yes")
      return

    bingoSet = set(bingo[x])
    if check2(bingoSet):
      r += 1

  if r == 3:
    print("Yes")
    return
  print("No")


def check1(s):
  return s.count(1) == 3


def check2(s):
  return not (0 in list(s))


def main():
  Cs = create_bingo_card()
  print(Cs)
  solvd(Cs)


if __name__ == "__main__":
    main()



As = [list(map(int, input().split())) for x in range(3)]
N = int(input())
bs = [int(input()) for x in range(N)]


def create_bingo_card():
  result = [[0, 0, 0] for x in range(3)]
  i = 0
  while True:
    i2 = 0
    while True:
      if bs[i2] in As[i]:
        result[i][As[i].index(bs[i2])] += 1
      i2 += 1
      if i2 == len(bs):
        break
    i += 1
    if i == len(As):
      break
  return result


def solvd(bingo):
  tmp = [bingo[0][0], bingo[1][1], bingo[2][2]]
  if check1(tmp):
    print("Yes")
    return

  tmp = [bingo[0][2], bingo[1][1], bingo[2][0]]
  if check1(tmp):
    print("Yes")
    return

  r = 0
  for x in range(3):
    tmp = [bingo[0][x], bingo[1][x], bingo[2][x]]
    if check1(tmp):
      print("Yes")
      return

    bingoSet = set(bingo[x])
    if check2(bingoSet):
      r += 1

  if r >= 1:
    print("Yes")
    return
  print("No")


def check1(s):
  return s.count(1) == 3


def check2(s):
  return not (0 in list(s))


def main():
  Cs = create_bingo_card()
  solvd(Cs)


if __name__ == "__main__":
    main()

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):
S="012 345 678 036 147 258 048 246 "
A=sum([input().split()for i in range(4)],[])
for b in [input()for i in range(int(A[9]))]:
  if b in A:
    S=S.replace(str(A.index(b)),"")
print("YNeos"[1-"  "in S::2])

S="012 345 678 036 147 258 048 246 "
A=sum([input().split()for i in range(4)],[])
for b in [input()for i in range(int(A[10]))]:
  if b in A:
    S=S.replace(str(A.index(b)),"")
print("YNeos"[S.find("  ")<0::2])

S="012 345 678 036 147 258 048 246 "
A=sum([input().split()for i in range(4)],[])
for b in [input()for i in range(int(A[9]))]:
  if b in A:
    S=S.replace(str(A.index(b)),"")
print("NYoe s"["  "in S::2])

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):
# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py


b=[[0,0,0]]*3
#print(b)
m={}
for i in range(3):
    t=list(map(int,input().split()))
    k=0
    for j in t:
        m[j]=(i,k)
        k+=1
n=int(input())
for i in n:
    t=int(input())
    if t in m:
        #print(m[t])
        b[m[t][0]][m[t][1]]=1
for i in b:
    ans=1
    for j in i:
        ans*=j
    if ans==1:
        print('Yes')
        exit()
for i in range(3):
    ans=1
    for j in range(3):
        ans*=b[j][i]
    if ans==1:
        print('Yes')
        exit()
if b[0][0]*b[1][1]*b[2][2]==1:
    print('Yes')
    exit()
if b[0][2]*b[1][1]*b[2][0]==1:
    print('Yes')
    exit()
print('No')

# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py


b=[[0,0,0],[0,0,0],[0,0,0]]
#print(b)
m={}
for i in range(3):
    t=list(map(int,input().split()))
    k=0
    for j in t:
        m[j]=(i,k)
        k+=1
n=int(input())
for i in range(n):
    t=int(input())
    if t in m:
        #print(m[t])
        b[m[t][0]][m[t][1]]=1
for i in b:
    ans=1
    for j in i:
        ans*=j
    if ans==1:
        print('Yes')
        exit()
for i in range(3):
    ans=1
    for j in range(3):
        ans*=b[j][i]
    if ans==1:
        print('Yes')
        exit()
if b[0][0]*b[1][1]*b[2][2]==1:
    print('Yes')
    exit()
if b[0][2]*b[1][1]*b[2][0]==1:
    print('Yes')
    exit()
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):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]]]

all = yoko + tate + naname

y = 0
for kumi in all:
	chk = 0
	for i in range(3):
		for n in b:
			if kumi[i] == n:
				chk += 1
	if chk == 3:
		print("Yes")
		y = 1
	break

if y == 0:
	print("No")

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]], [A[0][3], A[1][1], A[2][0]]]

all = yoko + tate + naname

y = 0
chk = 0
for kumi in all:
	for k in kumi:
		if k in b:
			chk += 1
		else:
			continue
	if chk == 3:
		print("Yes")
		y = 1
		break
	else:
		chk = 0
		
if y == 0:
	print("No")

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]]]

all = yoko + tate + naname



for kumi in all:
	for i in range(3):
		chk = 0
		if kumi[i] in b:
			chk += 1
		if chk == 3:
			print("Yes")
		break
	if chk == 3:
		break

if chk != 3:
	print("No")

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
	b.append(int(input()))
	
yoko = A
tate = [[], [], []]
for row in A:
	for i in range(3):
		tate[i].append(row[i])
naname = [[A[0][0], A[1][1], A[2][2]], [A[0][2], A[1][1], A[2][0]]]

all = yoko + tate + naname

y = 0
chk = 0
for kumi in all:
	for k in kumi:
		if k in b:
			chk += 1
		else:
			continue
	if chk == 3:
		print("Yes")
		y = 1
		break
	else:
		chk = 0
		
if y == 0:
	print("No")

Verdicts: Wrong Answer

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):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)
 
def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
 
def main():
    A = [LI() for _ in range(3)]
    N = I()
    B = [I() for _ 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
                    break

    ans = 'No'
    for i in range(3):
            if (A[i][0]==0 and A[i][1]==0 and A[i][2]==0) or (A[0][i]==0 and A[1][i]==0 and A[2][i]==0):
              ans = 'Yes'
              break  
    if (A[0][2]==0 and A[1][1]==0 and A[2][0]==0) or A[0][0]==0 and A[1][1]==0 and A[2][2]:
        ans = 'Yes'
    print(ans)
main()

import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)
 
def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
 
def main():
    A = [LI() for _ in range(3)]
    N = I()
    B = [I() for _ in range(N)]
    
    
    Hit = [[False] * 3, [False] * 3, [False] * 3]
    for i in range(3):
        for j in range(3):
            for k in range(N):
                if A[i][j]== B[k]:
                    Hit[i][j] = True
                    break
    
    ans = False
    for i in range(3):
            if (Hit[i][0] and Hit[i][1] and Hit[i][2]) or (Hit[0][i] and Hit[1][i] and Hit[2][i]):
              ans = True
              break  
    if (A[0][2] and Hit[1][1] and Hit[2][0]) or (Hit[0][0] and Hit[1][1] and Hit[2][2]):
        ans = True

    if ans:
        print('Yes')
    else:
        print('No')
main()

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
lst = []
nums = []
for _ in range(3):
    l = []
    l = list(map(int, input().split()))
    lst.append(l)
    lst = np.array(lst)
n = int(input())
for _ in range(n):
    nums.append(int(input()))

for h in range(3):
    for w in range(3):
        if array[h][w] in nums:
            array[h][w] = 0

i = 0
for h in range(3):
    if sum(array[:, h]) == 0:
        i = 1
for w in range(3):
    if sum(array[w]) == 0:
        i = 1
if sum(np.diag(np.fliplr(array))) == 0:
    i = 1
if sum(np.diag(array)) == 0:
    i = 1

if i == 1:
    print("Yes")
else:
    print('No')

import numpy as np
lst = []
nums = []
for _ in range(3):
    l = []
    l = list(map(int, input().split()))
    lst.append(l)
    array = np.array(lst)
 
n = int(input())
for _ in range(n):
    nums.append(int(input()))

for h in range(3):
    for w in range(3):
        if array[h][w] in nums:
            array[h][w] = 0

i = 0
for h in range(3):
    if sum(array[:, h]) == 0:
        i = 1
for w in range(3):
    if sum(array[w]) == 0:
        i = 1
if sum(np.diag(np.fliplr(array))) == 0:
    i = 1
if sum(np.diag(array)) == 0:
    i = 1

if i == 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):
import numpy as np

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

# n = int(input())

# b = list([int(input()) for _ in range(n)])

c = [[0]*3]*3

for k in b:
#     print("k={}".format(k))
    for i in range(3):
        for j in range(3):
#             print("  a={}".format(a[i][j]))
            if k == a[i][j]:
                c[i][j]=1

c = np.array(c)

if (max(c.sum(axis=0))==3) or (max(c.sum(axis=1))==3) or \
    (sum([a[i,i] for i in range(3)])==3) or (sum(a[2,0]+a[1,1]+a[0,2])==3):
    print("Yes")
else:
    print("No")

import numpy as np

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

n = int(input())

b = list([int(input()) for _ in range(n)])

c = np.zeros(9).reshape(3,3)

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

if (max(c.sum(axis=0))==3) or (max(c.sum(axis=1))==3) or \
    (sum([c[i,i] for i in range(3)])==3) or (c[2,0]+c[1,1]+c[0,2]==3):
    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 sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    import numpy as np
    A = [list(map(int,readline().split())) for _ in range(3)]
    N, *b = map(int, read().split())
    A = np.array(A)
    B = np.zeros(A.shape)
    for i in A.reshape(-1):
        if i in b:
            print(np.where(A == i))
            B[np.where(A == i)] = 1
    for i in range(3):
        if np.all(B[i, :] == 1):
            print('Yes')
            break
        if np.all(B[:, i] == 1):
            print('Yes')
            break
    else:
        if B[0,0]==B[1,1]==B[2,2]==1:
            print('Yes')
        elif B[0,2]==B[1,1]==B[2,0]==1:
            print('Yes')
        else:
            print('No')
    print(B)
    return
if __name__ == '__main__':
    main()



import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    import numpy as np
    A = [list(map(int,readline().split())) for _ in range(3)]
    N, *b = map(int, read().split())
    A = np.array(A)
    B = np.zeros(A.shape)
    for i in A.reshape(-1):
        if i in b:
            B[np.where(A == i)] = 1
    for i in range(3):
        if np.all(B[i, :] == 1):
            print('Yes')
            break
        if np.all(B[:, i] == 1):
            print('Yes')
            break
    else:
        if B[0,0]==B[1,1]==B[2,2]==1:
            print('Yes')
        elif B[0,2]==B[1,1]==B[2,0]==1:
            print('Yes')
        else:
            print('No')
    return
if __name__ == '__main__':
    main()



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):
card = [input().split(' '), input().split(' '), input().split(' ')]
count = int(input())

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

for _ in range(count):
    b = int(input())
    for i, cc in enumerate(card):
        for j, c in enumerate(cc):
            if c == b:
                result[i][j] = 1

for i in range(3):
    if card[i][0] == card[i][1] == card[i][2] == 1:
        print('Yes')
        exit(0)
    if card[0][i] == card[1][i] == card[2][i] == 1:
        print('Yes')
        exit(0)
if card[0][0] == card[1][1] == card[2][2] == 1:
    print('Yes')
    exit(0)
if card[0][2] == card[1][1] == card[2][0] == 1:
    print('Yes')
    exit(0)
print('No')

card = [
    list(map(int, input().split(' '))),
    list(map(int, input().split(' '))),
    list(map(int, input().split(' ')))
]

count = int(input())

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

for _ in range(count):
    b = int(input())
    for i, cc in enumerate(card):
        for j, c in enumerate(cc):
            if c == b:
                result[i][j] = 1

for i in range(3):
    if result[i][0] == result[i][1] == result[i][2] == 1:
        print('Yes')
        exit(0)
    if result[0][i] == result[1][i] == result[2][i] == 1:
        print('Yes')
        exit(0)
if result[0][0] == result[1][1] == result[2][2] == 1:
    print('Yes')
    exit(0)
if result[0][2] == result[1][1] == result[2][0] == 1:
    print('Yes')
    exit(0)
print('No')


Verdicts: Wrong Answer

Accepted