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):
import sys
card = [[int(x) for x in input().split(' ') ] for _ in range(3)]

patterns = []

patterns += [[card[i][j] for i in range(3)] for j in range(3)]
patterns += [[card[j][i] for i in range(3)] for j in range(3)]
patterns.append([card[i][i] for i in range(3)])
patterns.append([card[2-i][2-i] for i in range(3)] )

N = int(input())
for _ in range(N):
    b = int(input())
    for pat in patterns:
        if b in pat:
            pat.remove(b)
        
        if len(pat)==0:
            print('YES')
            sys.exit()

print('NO')

import sys
card = [[int(x) for x in input().split(' ') ] for _ in range(3)]

patterns = []

patterns += [[card[i][j] for i in range(3)] for j in range(3)]
patterns += [[card[j][i] for i in range(3)] for j in range(3)]
patterns.append([card[i][i] for i in range(3)])
patterns.append([card[i][2-i] for i in range(3)] )

print(patterns)

ok = False
N = int(input())
for _ in range(N):
    b = int(input())
    for pat in patterns:
        while b in pat:
            pat.remove(b)
    
print(patterns)
        
for pat in patterns:
    if len(pat) == 0:
        print('Yes')
        sys.exit()

print('No')

import sys
card = [[int(x) for x in input().split(' ') ] for _ in range(3)]

patterns = []

patterns += [[card[i][j] for i in range(3)] for j in range(3)]
patterns += [[card[j][i] for i in range(3)] for j in range(3)]
patterns.append([card[i][i] for i in range(3)])
patterns.append([card[2-i][2-i] for i in range(3)] )

ok = False
N = int(input())
for _ in range(N):
    b = int(input())
    for pat in patterns:
        if b in pat:
            pat.remove(b)
        
        if len(pat)==0:
            ok = True

if ok:
    print('YES')
else:
    print('NO')

import sys
card = [[int(x) for x in input().split(' ') ] for _ in range(3)]

patterns = []

patterns += [[card[i][j] for i in range(3)] for j in range(3)]
patterns += [[card[j][i] for i in range(3)] for j in range(3)]
patterns.append([card[i][i] for i in range(3)])
patterns.append([card[i][2-i] for i in range(3)] )

ok = False
N = int(input())
for _ in range(N):
    b = int(input())
    for pat in patterns:
        while b in pat:
            pat.remove(b)
            
for pat in patterns:
    if len(pat) == 0:
        print('Yes')
        sys.exit()

print('No')

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):
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))

a = inl()
b = inl()
c = inl()
n = ini()
bingo = []
for _ in range(n):
    bingo.append(ini())
ct = [0] * 9
for i in bingo:
    if i in a:
        ct[a.index(i)] = 1
    if i in b:
        ct[b.index(i) + 3] = 1
    if i in c:
        ct[c.index(i) + 6] = 1
print(ct)
if sum(ct[:3]) == 3 or sum(ct[3:6]) == 3 or sum(ct[6:9]) == 3:
    print("Yes")
elif ct[0] + ct[4] + ct[8] == 3 or ct[2] + ct[4] + ct[6] == 3:
    print("Yes")
elif ct[0] + ct[3] + ct[6] == 3 or ct[1] + ct[4] + ct[7] == 3 or ct[2] + ct[5] + ct[8] == 3:
    print("Yes")
else:
    print("No")    

import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))

a = inl()
b = inl()
c = inl()
n = ini()
bingo = []
for _ in range(n):
    bingo.append(ini())
ct = [0] * 9
for i in bingo:
    if i in a:
        ct[a.index(i)] = 1
    if i in b:
        ct[b.index(i) + 3] = 1
    if i in c:
        ct[c.index(i) + 6] = 1
if sum(ct[:3]) == 3 or sum(ct[3:6] or sum(ct[6:9]) == 3):
    print("YES")
elif ct[0] + ct[4] + ct[8] == 3 or ct[2] + ct[4] + ct[6]:
    print("YES")
else:
    print("NO")    

import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))

a = inl()
b = inl()
c = inl()
n = ini()
bingo = []
for _ in range(n):
    bingo.append(ini())
ct = [0] * 9
for i in bingo:
    if i in a:
        ct[a.index(i)] = 1
    if i in b:
        ct[b.index(i) + 3] = 1
    if i in c:
        ct[c.index(i) + 6] = 1
if sum(ct[:3]) == 3 or sum(ct[3:6]) == 3 or sum(ct[6:9]) == 3:
    print("Yes")
elif (ct[0] + ct[4] + ct[8]) == 3 or (ct[2] + ct[4] + ct[6]) == 3:
    print("Yes")
elif (ct[0] + ct[3] + ct[6]) == 3 or (ct[1] + ct[4] + ct[7]) == 3 or (ct[2] + ct[5] + ct[8]) == 3:
    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):
def main():
    import itertools
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    c = list(map(int,input().split()))
    d = [a[0],b[0],c[0]]
    e = [a[1],b[1],c[1]]
    f = [a[2],b[2],c[2]]
    g = [a[0],b[1],c[2]]
    h = [a[2],b[1],c[0]]
    n = int(input())
    listB = [int(input()) for x in range(n)]
    C = itertools.combinations(listB,3)
    if a in C or b in C or c in C or d in C or e in C or f in C or g in C or h in C:
      print("Yes")
    else:
      print("No")
main()

def main():
    import itertools
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    c = list(map(int,input().split()))
    d = [a[0],b[0],c[0]]
    e = [a[1],b[1],c[1]]
    f = [a[2],b[2],c[2]]
    g = [a[0],b[1],c[2]]
    h = [a[2],b[1],c[0]]
    n = int(input())
    listB = [int(input()) for x in range(n)]
    C = itertools.combinations(listB,3)
    D = list(C)
    if a in D or b in D or c in D or d in D or e in D or f in D or g in D or h in D:
      print("Yes")
    else:
      print("No")
main()

def main():
    import math
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    c = list(map(int,input().split()))
    d = [a[0],b[0],c[0]]
    e = [a[1],b[1],c[1]]
    f = [a[2],b[2],c[2]]
    g = [a[0],b[1],c[2]]
    h = [a[2],b[1],c[0]]
    n = int(input())
    listB = [int(input()) for x in range(n)]
    C = itertools.combinations(listB,3)
    if a in C or b in C or c in C or d in C or e in C or f in C or g in C or h in C:
      print("Yes")
    else:
      print("No")
main()

def main():
    S = str(input())
    T = str(input())
    a = int(0)
    for x in range(len(S)):
      if S[x]!=T[x]:
          a = a + 1
    print(int(a))
main()

def main():
    import itertools
    a = tuple(map(int,input().split()))
    b = tuple(map(int,input().split()))
    c = tuple(map(int,input().split()))
    d = (a[0],b[0],c[0])
    e = (a[1],b[1],c[1])
    f = (a[2],b[2],c[2])
    g = (a[0],b[1],c[2])
    h = (a[2],b[1],c[0])
    n = int(input())
    listB = [int(input()) for x in range(n)]
    X = itertools.permutations(listB,3)
    R = list(X)
    if a in R or b in R or c in R or d in R or e in R or f in R or g in R or h in R:
      print("Yes")
    else:
      print("No")
main()


Verdicts: Wrong Answer

Wrong Answer

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):
# B
a = []
for i in range(3):
    a1, a2, a3 = map(int, input().split())
    a.append(a1)
    a.append(a2)
    a.append(a3)
    
print(a)
    
n = int(input())
b = []
for i in range(n):
    bb = int(input())
    b.append(bb)
    
for i in range(n):
    while a.count(b[i]) > 0:
        a[a.index(b[i])] = 0
        
if a[0] == a[3] == a[6] == 0:
    print('Yes')
elif a[1] == a[4] == a[7] == 0:
    print('Yes')
elif a[2] == a[5] == a[8] == 0:
    print('Yes')
elif a[0] == a[1] == a[2] == 0:
    print('Yes')
elif a[3] == a[4] == a[5] == 0:
    print('Yes')
elif a[6] == a[7] == a[8] == 0:
    print('Yes')
elif a[0] == a[4] == a[8] == 0:
    print('Yes')
elif a[2] == a[4] == a[6] == 0:
    print('Yes')
else:
    print('No')

# B
a = []
for i in range(3):
    a1, a2, a3 = map(int, input().split())
    a.append(a1)
    a.append(a2)
    a.append(a3)
    
n = int(input())
b = []
for i in range(n):
    bb = int(input())
    b.append(bb)
    
for i in range(n):
    while a.count(b[i]) > 0:
        a[a.index(b[i])] = 0
        
if a[0] == a[3] == a[6] == 0:
    print('Yes')
elif a[1] == a[4] == a[7] == 0:
    print('Yes')
elif a[2] == a[5] == a[8] == 0:
    print('Yes')
elif a[0] == a[1] == a[2] == 0:
    print('Yes')
elif a[3] == a[4] == a[5] == 0:
    print('Yes')
elif a[6] == a[7] == a[8] == 0:
    print('Yes')
elif a[0] == a[4] == a[8] == 0:
    print('Yes')
elif a[2] == a[4] == a[6] == 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):
res = False
for row in a:
    if all(num in b for num in row):
        res = True
for col in zip(a):
    if all(num in b for num in col):
        res = True
if all(a[i][i] in b for i range(3)):
        res = True
if all(a[i][2 - i] in b for i range(3)):
        res = True


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

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

Size = 3
bingo = False
for row in a:
    if all(item in b for item in row):
        bingo = True
for col in zip(*a):
    if all(item in b for item in col):
        bingo = True
if all(a[i][i] in b for i in range(Size)):
    bingo = True
if all(a[i][Size - 1 - i] in b for i in range(Size)):
    bingo = True
 
print("Yes" if bingo else "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):
#157 b
a=[]
call_num=[]
for i in range(3):
    x,y,z=map(int,input().split())
    a.append(x)
    a.append(y)
    a.append(z)
n=int(input())
for i in range(n):
    x=int(input())
    if x in a:
        call_num.append(a.index(x))
bingo
ans=[[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 x in ans:
    flag=True
    for y in x:
        if y not in call_num:
            flag=False
    if flag:
        print("Yes")
        bing=True
        break
if bingo!=True:        
    print("No")


#157 b 
a=[]
call_num=[]
for i in range(3):
    x,y,z=map(int,input().split())
    a.append(x)
    a.append(y)
    a.append(z)
n=int(input())
for i in range(n):
    x=int(input())
    if x in a:
        call_num.append(a.index(x))
bingo
ans=[[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 x in ans:
    flag=True
    for y in x:
        if y not in call_num:
            flag=False
    if flag:
        print("Yes")
        bing=True
        break
if bing!=True:        
    print("No")


#157 b
a=[]
call_num=[]
for i in range(3):
    x,y,z=map(int,input().split())
    a.append(x)
    a.append(y)
    a.append(z)
n=int(input())
for i in range(n):
    x=int(input())
    if x in a:
        call_num.append(a.index(x))
bingo=False
ans=[[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 x in ans:
    flag=True
    for y in x:
        if y not in call_num:
            flag=False
    if flag:
        print("Yes")
        bingo=True
        break
if bingo!=True:
    print("No")

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):
import sys

bingo = [ list(map(int, input().split())) for _ in range(3) ]
t_or_f = [ [False]*3 for _ in range(3) ]

nums = [ r for i in range(3) for r in bingo ]

n = int(input())
for _ in range(n):
  i = int(input())

  if i in nums:
    for x in range(3):
      for y in range(3):
        if bingo[x][y] == i:
          t_or_f[x][y] = True
          break


is_bingo = False
if t_or_f[0][0] and t_or_f[1][1] and t_or_f[2][2]:
  is_bingo = True
  print('Yes')
elif t_or_f[0][2] and t_or_f[1][1] and t_or_f[2][0]:
  is_bingo = True
  print('Yes')
else:
  for i in range(3):
    if t_or_f[i][i] and t_or_f[i+1][i+1] and t_or_f[i+2][i+2]:
      is_bingo = True
      print('Yes')
      sys.exit()

if not is_bingo: print('No')




bingo = [ list(map(int, input().split())) for _ in range(3) ]
t_or_f = [ [False]*3 for _ in range(3) ]

nums = [ r[i]for i in range(3) for r in bingo ]

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

for x in range(3):
  for y in range(3):
    if bingo[x][y] in appear:
      t_or_f[x][y] = True

is_bingo = False
if t_or_f[0][0] and t_or_f[1][1] and t_or_f[2][2]:
  is_bingo = True
elif t_or_f[0][2] and t_or_f[1][1] and t_or_f[2][0]:
  is_bingo = True
else:
  for i in range(3):
    if t_or_f[i][0] and t_or_f[i][1] and t_or_f[i][2]: is_bingo = True
    if t_or_f[0][i] and t_or_f[1][i] and t_or_f[2][i]: is_bingo = True

if is_bingo:
  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):
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
seat = [a1, a2, a3]
n = int(input())
b = [int(input()) for i in range(n)]

seat_tf = [[False, False, False] for _ in range(3)]

for k in b:
    for i in range(3):
        for j in range(3):
            if seat[i][j] == b:
                seat_tf[i][j] = True

for i in range(3):
    if seat_tf[i][0] and seat_tf[i][1] and seat_tf[i][2]:
        print("Yes")
        exit()

for j in range(3):
    if seat_tf[0][j] and seat_tf[1][j] and seat_tf[2][j]:
        print("Yes")
        exit()

if (seat_tf[0][0] and seat_tf[1][1] and seat_tf[2][2]) or (seat_tf[0][2] and seat_tf[1][1] and seat_tf[2][0]):
    print("Yes")
    exit()
print("No")

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
seat = [a1, a2, a3]
n = int(input())
b = [int(input()) for i in range(n)]

seat_tf = [[False, False, False] for _ in range(3)]

for k in b:
    for i in range(3):
        for j in range(3):
            if seat[i][j] == k:
                seat_tf[i][j] = True

for i in range(3):
    if seat_tf[i][0] and seat_tf[i][1] and seat_tf[i][2]:
        print("Yes")
        exit()

for j in range(3):
    if seat_tf[0][j] and seat_tf[1][j] and seat_tf[2][j]:
        print("Yes")
        exit()

if (seat_tf[0][0] and seat_tf[1][1] and seat_tf[2][2]) or (seat_tf[0][2] and seat_tf[1][1] and seat_tf[2][0]):
    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):

data = []
for j in range(3):
  data.extend([int (i) for i in input().split()])

bingo_dic = {}
for i, d in enumerate(data):
  bingo_dic[d] = i
  
N = int(input())

bingo = [0,0,0,0,0,0,0,0,0]
for _ in range(N):
  i = int(input())
  if i in bingo_dic.keys():
    bingo[bingo_dic[i]] = 1
    
if bingo[0] + bingo[1] + bingo[2] == 3:
  print('yes')
  exit()
  
if bingo[3] + bingo[4] + bingo[5] == 3:
  print('yes')
  exit()
  
if bingo[6] + bingo[7] + bingo[8] == 3:
  print('yes')
  exit()
  
if bingo[0] + bingo[3] + bingo[6] == 3:
  print('yes')
  exit()

if bingo[1] + bingo[4] + bingo[7] == 3:
  print('yes')
  exit()
  
if bingo[2] + bingo[5] + bingo[8] == 3:
  print('yes')
  exit()
  
if bingo[0] + bingo[4] + bingo[8] == 3:
  print('yes')
  exit()

if bingo[2] + bingo[4] + bingo[6] == 3:
  print('yes')
  exit()

print('no')

data = []
for j in range(3):
  data.extend([int (i) for i in input().split()])

bingo_dic = {}
for i, d in enumerate(data):
  bingo_dic[d] = i
  
N = int(input())

bingo = [0,0,0,0,0,0,0,0,0]
for _ in range(N):
  i = int(input())
  if i in bingo_dic.keys():
    bingo[bingo_dic[i]] = 1
    
if bingo[0] + bingo[1] + bingo[2] == 3:
  print('yes')
  exit()
  
if bingo[3] + bingo[4] + bingo[5] == 3:
  print('yes')
  exit()
  
if bingo[6] + bingo[7] + bingo[8] == 3:
  print('yes')
  exit()
  
if bingo[0] + bingo[3] + bingo[6] == 3:
  print('yes')
  exit()

if bingo[1] + bingo[4] + bingo[7] == 3:
  print('yes')
  exit()
  
if bingo[2] + bingo[5] + bingo[8] == 3:
  print('yes')
  exit()
  
if bingo[0] + bingo[4] + bingo[8] == 3:
  print('yes')
  exit()

if bingo[2] + bingo[4] + bingo[6] == 3:
  print('yes')
  exit()

print('no')

data = []
for j in range(3):
  data.extend([int (i) for i in input().split()])

bingo_dic = {}
for i, d in enumerate(data):
  bingo_dic[d] = i
  
N = int(input())

bingo = [0,0,0,0,0,0,0,0,0]
for _ in range(N):
  i = int(input())
  if i in bingo_dic.keys():
    bingo[bingo_dic[i]] = 1
    
if bingo[0] + bingo[1] + bingo[2] == 3:
  print('Yes')
  exit()
  
if bingo[3] + bingo[4] + bingo[5] == 3:
  print('Yes')
  exit()
  
if bingo[6] + bingo[7] + bingo[8] == 3:
  print('Yes')
  exit()
  
if bingo[0] + bingo[3] + bingo[6] == 3:
  print('Yes')
  exit()

if bingo[1] + bingo[4] + bingo[7] == 3:
  print('Yes')
  exit()
  
if bingo[2] + bingo[5] + bingo[8] == 3:
  print('Yes')
  exit()
  
if bingo[0] + bingo[4] + bingo[8] == 3:
  print('Yes')
  exit()

if bingo[2] + bingo[4] + bingo[6] == 3:
  print('Yes')
  exit()

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):
f=lambda a:any(all(b)for b in a)or all(a[i][i]for i in(0,1,2))   
a=eval('list(map(int,input().split())),'*3)
exec('b=int(input());a=[[u*(u!=b)for u in t]for t in a];'*int(input()))
a=[[not u for u in t]for t in a]
print('NYoe s'[f(a)|f(t[::-1]for t in zip(*a))::2])

s,a=',036,048,246,258,345,678,',open(0).read().split()
for i in a[9:]:s=s.replace(str(a.index(i)),'')
print('NYoe s'[',,'in s::2])

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 _ in range(3):
    a.append(list(map(int,input().split()))) 
print(a)
n = int(input())
num_list = []
for _ in range(n):
    num_list.append(int(input()))
    
flg = False
for i in range(3):
    if a[i][0] in num_list and a[i][1] in num_list and a[i][2] in num_list:
        flg = True
        break
diago = list([a[0][0],a[1][1],a[2][2]])

if flg != True:
    if diago[0] in num_list and diago[1] in num_list and diago[2] in num_list:
        flg = True

if flg:
    print("Yes")
else:
    print("No")

a = []
for _ in range(3):
    a.append(list(map(int,input().split()))) 
n = int(input())
num_list = []
for _ in range(n):
    num_list.append(int(input()))
    
flg = False
for i in range(3):
    if a[i][0] in num_list and a[i][1] in num_list and a[i][2] in num_list:
        flg = True
        break
        
for i in range(3):
    if a[0][i] in num_list and a[1][i] in num_list and a[2][i] in num_list:
        flg = True
        break
        
if flg != True:
    diago = list([a[0][0],a[1][1],a[2][2]])
    if diago[0] in num_list and diago[1] in num_list and diago[2] in num_list:
        flg = True
        
if flg != True:
    diago2 = list([a[2][0],a[1][1],a[2][0]])
    if diago2[0] in num_list and diago2[1] in num_list and diago2[2] in num_list:
        flg = True
        
if flg:
    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):

A1=list(map(int,input().split()))
A2=list(map(int,input().split()))
A3=list(map(int,input().split()))
N=int(input())
b=[0]*N
for i in range(N):
  print(i)
  b[i]=int(input())
C1=any([i == A1[0] for i in b])
C2=any([i == A1[1] for i in b])
C3=any([i == A1[2] for i in b])
C4=any([i == A2[0] for i in b])
C5=any([i == A2[1] for i in b])
C6=any([i == A2[2] for i in b])
C7=any([i == A3[0] for i in b])
C8=any([i == A3[1] for i in b])
C9=any([i == A3[2] for i in b])

if(any(all(C1,C2,C3),all(C4,C5,C6),all(C7,C8,C9),all(C1,C4,C7),all(C2,C5,C8),all(C3,C6,C9),all(C1,C5,C9),all(C3,C5,C7)):
   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())
b=[0]*N
for i in range(N):
  b[i]=int(input())
C1=any([i == A1[0] for i in b])
C2=any([i == A1[1] for i in b])
C3=any([i == A1[2] for i in b])
C4=any([i == A2[0] for i in b])
C5=any([i == A2[1] for i in b])
C6=any([i == A2[2] for i in b])
C7=any([i == A3[0] for i in b])
C8=any([i == A3[1] for i in b])
C9=any([i == A3[2] for i in b])

if(any([all([C1,C2,C3]),all([C4,C5,C6]),all([C7,C8,C9]),all([C1,C4,C7]),all([C2,C5,C8]),all([C3,C6,C9]),all([C1,C5,C9]),all([C3,C5,C7])])):
   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):
60 88 34
92 41 43
65 73 48
10
60
43
88
11
48
73
65
41
92
34


b = []
b.append([int(s) for s in input().split()])
b.append([int(s) for s in input().split()])
b.append([int(s) for s in input().split()])

n = int(input())

for i in range(0, n):
    v = int(input())

    for i in range(0, 3):
        for j in range(0, 3):
            if b[i][j] == v:
                b[i][j] = 999

ans = 'NO'

for i in range(0, 3):
    s = set(b[i])

    if len(s) == 1:
        ans = 'YES'

for i in range(0, 3):
    s = set([b[0][i], b[1][i], b[2][i]])

    if len(s) == 1:
        ans = 'YES'

c = set([b[0][0], b[1][1], b[2][2]])

if len(c) == 1:
    ans = 'YES'

c = set([b[0][2], b[1][1], b[2][0]])

if len(c) == 1:
    ans = 'YES'

print(ans)

b = []
b.append([int(s) for s in input().split()])
b.append([int(s) for s in input().split()])
b.append([int(s) for s in input().split()])

n = int(input())

for i in range(0, n):
    v = int(input())

    for i in range(0, 3):
        for j in range(0, 3):
            if b[i][j] == v:
                b[i][j] = 999

ans = 'NO'

for i in range(0, 3):
    s = set(b[i])

    if len(s) == 1:
        ans = 'YES'

for i in range(0, 3):
    s = set([b[0][i], b[1][i], b[2][i]])

    if len(s) == 1:
        ans = 'YES'

c = set([b[0][0], b[1][1], b[2][2]])

if len(c) == 1:
    ans = 'YES'

c = set([b[0][2], b[1][1], b[2][0]])

if len(c) == 1:
    ans = 'YES'

print(ans)

b = []
b.append([int(s) for s in input().split()])
b.append([int(s) for s in input().split()])
b.append([int(s) for s in input().split()])

n = int(input())

for i in range(0, n):
    v = int(input())

    for i in range(0, 3):
        for j in range(0, 3):
            if b[i][j] == v:
                b[i][j] = 999

ans = 'No'

for i in range(0, 3):
    s = set(b[i])

    if len(s) == 1:
        ans = 'Yes'

for i in range(0, 3):
    s = set([b[0][i], b[1][i], b[2][i]])

    if len(s) == 1:
        ans = 'Yes'

c = set([b[0][0], b[1][1], b[2][2]])

if len(c) == 1:
    ans = 'Yes'

c = set([b[0][2], b[1][1], b[2][0]])

if len(c) == 1:
    ans = 'Yes'

print(ans)

Verdicts: Runtime Error

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):

ls_a = []
for i in range(3):
    ls_a.extend(list(map(int,input().split())))
n = int(input())
ls_b = [int(input()) for i in range(n)]

for i in range(9):
    if ls_a[i] in ls_b:
        ls_a[i] = 0

print(ls_a,ls_b)
for i in range(3):
    if ls_a[i] == 0 and ls_a[i+3] == 0 and ls_a[i+6] == 0:
        print("Yes")
        exit()
    if ls_a[i*3] == 0 and ls_a[i*3+1] == 0 and ls_a[i*3+2] == 0:
        print("Yes")
        exit()
if ls_a[0] == 0 and ls_a[4] == 0 and ls_a[8] == 0:
    print("Yes")
    exit()
if ls_a[2] == 0 and ls_a[4] == 0 and ls_a[6] == 0:
    print("Yes")
    exit()
print("No")
            


ls_a = []
for i in range(3):
    ls_a.extend(list(map(int,input().split())))
n = int(input())
ls_b = [int(input()) for i in range(n)]

for i in range(9):
    if ls_a[i] in ls_b:
        ls_a[i] = 0

for i in range(3):
    if ls_a[i] == 0 and ls_a[i+3] == 0 and ls_a[i+6] == 0:
        print("Yes")
        exit()
    if ls_a[i*3] == 0 and ls_a[i*3+1] == 0 and ls_a[i*3+2] == 0:
        print("Yes")
        exit()
if ls_a[0] == 0 and ls_a[4] == 0 and ls_a[8] == 0:
    print("Yes")
    exit()
if ls_a[2] == 0 and ls_a[4] == 0 and ls_a[6] == 0:
    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):
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())

i = 0
while i<N:
  b = int(input())
  j=0
  while j<3:
    k=0
    while k<3:
      if A[j][k]==b:
        A[j][k]=0
      k+=1
    j+=1
  i+=1

flag = False
i = 0
while i<3:
  if A[i][0]+A[i][1]+A[i][2] == 0:
    flag = True
    break
  if A[0][i]+A[1][i]+A[2][i] == 0:
    flag = True
    break
  i += 1

if A[0][0]+A[1][1]+A[2][2] == 0:
  flag = Trueå
if A[2][0]+A[1][1]+A[0][2] == 0:
  flag = True

if flag == True:
  print("Yes")
else:
    print("No")
    


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

i = 0
while i<N:
  b = int(input())
  j=0
  while j<3:
    k=0
    while k<3:
      if A[j][k]==b:
        A[j][k]=0
      k+=1
    j+=1
  i+=1

flag = False
i = 0
while i<3:
  if A[i][0]+A[i][1]+A[i][2] == 0:
    flag = True
    break
  if A[0][i]+A[1][i]+A[2][i] == 0:
    flag = True
    break
  i += 1

if A[0][0]+A[1][1]+A[2][2] == 0:
  flag = True
if A[2][0]+A[1][1]+A[0][2] == 0:
  flag = True

if flag == True:
  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):
mylist=[]

mylist= map(int,input().rstrip().split())
mylist= map(int,input().rstrip().split())
mylist = map(int,input().rstrip().split())

num = int(input())

for i in range(num):
    x = map(int,input().rstrip().split())
    k=0
    for j in mylist:
      if j==x:
        mylist[k]=0
      k+=1
            
bingo(0,1,2)
bingo(3,4,5)
bingo(6,7,8)
bingo(0,3,6)
bingo(1,4,7)
bingo(2,5,8)
bingo(0,4,8)
bingo(2,4,6)

      
def bingo(x,y,z):
  if mylist[a]==0 and mylist[b]==0 mylist[c]==0:
    print("Yes")
  else:
    print("No")

print(result)


a,b,c= map(int,input().rstrip().split())
d,e,f= map(int,input().rstrip().split())
g,h,i= map(int,input().rstrip().split())

mylist=[a,b,c,d,e,f,g,h,i]
num = int(input())

for i in range(num):
    x = int(input())
    k=0
    for j in mylist:
      if j==x:
        mylist[k]=0
      k+=1

x=0
def bingo(a,b,c):
  global x
  if mylist[a]==0 and mylist[b]==0 and mylist[c]==0:
    x=1
      
      
bingo(0,1,2)
bingo(3,4,5)
bingo(6,7,8)
bingo(0,3,6)
bingo(1,4,7)
bingo(2,5,8)
bingo(0,4,8)
bingo(2,4,6)


if x==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):
#N=int(input())
#N,M=map(int, input().split())
#L=list(map(int, input().split()))
L=[]
Check=[]
for n in range(9):
  Check.append(-(n+1))

for i in range(3):
  L.append(map(int, input().split()))

N=int(input())
for j in range(N):
  I=int(input())
  if I in L:
    Check[L.index(I)]=1
  
for k in range(3):
  if Check[0+3*k]==Check[1+3*k]==Check[2+3*k]:
    print('Yes')
    exit()

for l in range(3):
  if Check[0+l]==Check[3+l]==Check[6+l]:
    print('Yes')
    exit()

if Check[0]==Check[4]==Check[8] or Check[2]==Check[4]==Check[6]:
  print('Yes')
  exit()

print('No')

#N=int(input())
#N,M=map(int, input().split())
#L=list(map(int, input().split()))
L=[]
Check=[]
for n in range(9):
  Check.append(-(n+1))

for i in range(3):
  NL=list(map(int, input().split()))
  L.append(NL[0])
  L.append(NL[1])
  L.append(NL[2])

N=int(input())
for j in range(N):
  I=int(input())
  if I in L:
    Check[L.index(I)]=1
  
for k in range(3):
  if Check[0+3*k]==Check[1+3*k]==Check[2+3*k]:
    print('Yes')
    exit()

for l in range(3):
  if Check[0+l]==Check[3+l]==Check[6+l]:
    print('Yes')
    exit()

if Check[0]==Check[4]==Check[8] or Check[2]==Check[4]==Check[6]:
  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):
a,b,c = [input().split() for i in range(3)]

a.extend(b)
a.extend(c)
b = [input() for i in range(10)]
for b1 in b:
    a = ['a' if b1 == s in s else s for s in a]

if a[0] == 'a' and a[1] == 'a' and a[2] == 'a':
    print("Yes")
elif a[3] == 'a' and a[4] == 'a' and a[5] == 'a':
    print("Yes")
elif a[6] == 'a' and a[7] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[3] == 'a' and a[6] == 'a':
    print("Yes")
elif a[1] == 'a' and a[4] == 'a' and a[7] == 'a':
    print("Yes")
elif a[2] == 'a' and a[5] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[4] == 'a' and a[8] == 'a':
    print("Yes")
elif a[2] == 'a' and a[4] == 'a' and a[6] == 'a':
    print("Yes")


a,b,c = [input().split() for i in range(3)]

a.extend(b)
a.extend(c)
N = int(input())
b = [input() for i in range(N)]
for b1 in b:
    a = ['a' if b1 == s in s else s for s in a]

if a[0] == 'a' and a[1] == 'a' and a[2] == 'a':
    print("Yes")
elif a[3] == 'a' and a[4] == 'a' and a[5] == 'a':
    print("Yes")
elif a[6] == 'a' and a[7] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[3] == 'a' and a[6] == 'a':
    print("Yes")
elif a[1] == 'a' and a[4] == 'a' and a[7] == 'a':
    print("Yes")
elif a[2] == 'a' and a[5] == 'a' and a[8] == 'a':
    print("Yes")
elif a[0] == 'a' and a[4] == 'a' and a[8] == 'a':
    print("Yes")
elif a[2] == 'a' and a[4] == 'a' and a[6] == 'a':
    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):
card = []       
for i in range(3):      
    card.append(list(map(int,input().split())))

N = int(input())        

result = [[0,0,0],[0,0,0],[0,0,0]]      
for _ in range(N):      
    b = int(input())        
    for i in range(3):      
        for j in range(3):
            if b == card[i][j]:
                result[i][j] = 1

judge = "No"        

for i in range(3):      
    if result[i][0] * result[i][1] * result[i][2] == 1:
        judge = "Yes"

for i in range(3):      
    if result[0][i] * result[1][i]*result[2][i] == 1:
        judge = "Yes"

if result[0][0] * result[1][1] * result[2][2] == 1:     
    judge = "Yes"

if result[0][2] * result[1][1] : result[2][1] == 1:     
    judge = "Yes"

print(judge)    
 

card = []       
for i in range(3):      
    card.append(list(map(int,input().split())))

N = int(input())        

result = [[0,0,0],[0,0,0],[0,0,0]]      
for _ in range(N):      
    b = int(input())        
    for i in range(3):      
        for j in range(3):
            if b == card[i][j]:
                result[i][j] = 1

judge = "No"        

for i in range(3):      
    if result[i][0] * result[i][1] * result[i][2] == 1:
        judge = "Yes"

for i in range(3):      
    if result[0][i] * result[1][i] * result[2][i] == 1:
        judge = "Yes"

if result[0][0] * result[1][1] * result[2][2] == 1:     
    judge = "Yes"

if result[0][2] * result[1][1] * result[2][0] == 1:     
    judge = "Yes"

print(judge)    

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):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
n = int(input())
B = [int(input()) for i in range(n)]
for i in range(n):
  for j in range(3):
    for k in range(3):
      if B[i] == A[j][k]:
        A[j][k] = "*"
ans = ["*","*","*"]
for i in range(3):
  if A[i] == ans or [A[0][i],A[1][i],A[2][i]] == ans:
    print("Yes")
    exit()
    
if [A[0][0],A[1][1],A[2][2]] == ans or [A[2][0],A[1][1],A[0][2]] == ans:
  print("Yes")
else:
  pass

print("No")

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1,A2,A3]
n = int(input())
B = [int(input()) for i in range(n)]
for i in range(n):
  for j in range(3):
    for k in range(3):
      if B[i] == A[j][k]:
        A[j][k] = "*"
ans = ["*","*","*"]
for i in range(3):
  if A[i] == ans or [A[0][i],A[1][i],A[2][i]] == ans:
    print("Yes")
    exit()
    
if [A[0][0],A[1][1],A[2][2]] == ans or [A[0][2],A[1][1],A[2][0]] == ans:
  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):
def resolve():
    A = [list(map(int, input().split())) for _ in range(3)]
    N = int(input())
    B = [int(input()) for _ in range(N)]
    punch = [[False for _ in range(3)] for _ in range(3)]
    for i in range(3):
        for j in range(3):
            if A[i][j] in B:
                punch[i][j] = True
    print(punch, file=sys.stderr)
    ans = "No"
    for i in range(3):
        if False not in punch[i]:
            ans = "Yes"
            break
        for j in range(3):
            if not punch[j][i]:
                break
        else:
            ans = "Yes"
            break
    if (punch[0][0] and punch[1][1] and punch[2][2]) or (
            punch[0][2] and punch[1][1] and punch[2][0]):
        ans = "Yes"
    print(ans)


resolve()


def resolve():
    A = [list(map(int, input().split())) for _ in range(3)]
    N = int(input())
    B = [int(input()) for _ in range(N)]
    punch = [[False for _ in range(3)] for _ in range(3)]
    for i in range(3):
        for j in range(3):
            if A[i][j] in B:
                punch[i][j] = True
    ans = "No"
    for i in range(3):
        if False not in punch[i]:
            ans = "Yes"
            break
        for j in range(3):
            if not punch[j][i]:
                break
        else:
            ans = "Yes"
            break
    if (punch[0][0] and punch[1][1] and punch[2][2]) or (
            punch[0][2] and punch[1][1] and punch[2][0]):
        ans = "Yes"
    print(ans)


resolve()


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):
60 88 34
92 41 43
65 73 48
10
60
43
88
11
48
73
65
41
92
34

a = [int(j) for i in range(3) for j in input().split(' ')]
n = int(input())
nn = [int(input()) for i in range(n)]

for ni in nn:
  if ni in a:
    a[a.index(ni)] = 0

    
judge = "Yes"
if a[4]!=0:
  if a[2]!=0 and a[6]!=0:
    judge = "No"
else:
  if a[2]!=0 and a[6]!=0 and a[1]!=0 and a[7]!=0:
    judge = "No"

print(judge)

a = [int(j) for i in range(3) for j in input().split(' ')]
n = int(input())
nn = [int(input()) for i in range(n)]

for ni in nn:
  if ni in a:
    a[a.index(ni)] = 0

    
judge = "Yes"
if a[4]!=0 and a[2]!=0 and a[6]!=0:
  judge = "No"

if a[4]==0:
  if a[2]!=0 and a[6]!=0 and a[1]!=0 and a[7]!=0:
    judge = "No"

print(judge)

a = [int(j) for i in range(3) for j in input().split(' ')]
n = int(input())
nn = [int(input()) for i in range(n)]

cnt = 0
for ni in nn:
  if ni in a:
    cnt += 1
    a[a.index(ni)] = 0

judge = "No"
for i in range(3):
  if sum(a[i::3])==0 or sum(a[i*3:i*3+3])==0:
    judge = "Yes"
    
if sum(a[::4])==0 or (a[2]+a[4]+a[6])==0:
  judge = "Yes"
  
print(judge)

Verdicts: Runtime Error

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 = [input().split() for i in range(3)]
N = int(input())
b = [input() for i in range(N)]

for i in range(N):
	for j in range(3):
		for k in range(3):
			if A[j][k] == b[i]:
				A[j][k] = '○'

for i in range(3):
	if A[i][0] == A[i][1] == A[i][2]:
		print('YES')
		exit()
	elif A[0][i] == A[1][i] == A[2][i]:
		print('YES')
		exit()
	elif A[0][0] == A[1][1] == A[2][2] or A[0][2] == A[1][1] == A[2][0]:
		print('YES')
		exit()

print('NO')

A = [input().split() for i in range(3)]
N = int(input())
b = [input() for i in range(N)]

for i in range(N):
	for j in range(3):
		for k in range(3):
			if A[j][k] == b[i]:
				A[j][k] = '○'

for i in range(3):
	if A[i][0] == A[i][1] == A[i][2]:
		print('Yes')
		exit()
	elif A[0][i] == A[1][i] == A[2][i]:
		print('Yes')
		exit()
	elif A[0][0] == A[1][1] == A[2][2] or A[0][2] == A[1][1] == A[2][0]:
		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):
bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[i]:
      bingo[i][bingo[i].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      return 'No'
    
print(hantei(bingo))
    
    

bingo=[]
for i in range(3):
  a=list(map(int,input().split()))
  bingo.append(a)
  
n=int(input())
for i in range(n):
  b=int(input())
  for j in range(3):
    if b in bingo[j]:
      bingo[j][bingo[j].index(b)]=0
      
def hantei(l):
  for i in range(3):
    if all([l[i][j]==0 for j in range(3)]):
      return 'Yes'
    
    elif all([l[j][i]==0 for j in range(3)]):
      return 'Yes'
    
    elif l[0][0]==0 and l[1][1]==0 and l[2][2]==0:
      return 'Yes'
    
    elif l[0][2]==0 and l[1][1]==0 and l[2][0]==0:
      return 'Yes'
    
    else:
      continue
      
  return 'No'
    
#print(bingo)
print(hantei(bingo))

Verdicts: Runtime Error

Accepted