Submission #975505

# Submission time Handle Problem Language Result Execution time Memory
975505 2024-05-05T11:03:38 Z vjudge1 Pizza (COCI21_pizza) Python 3
0 / 50
13 ms 3160 KB
"""
3 7 2 4
5
3 1 2 3
3 4 5 6
3 7 8 9
3 1 3 6
3 2 4 7
"""
ndislike = int(input())
dislike = []
for i in range(ndislike):
  dislike.append(int(input()))

nbingkisan = int(input())
set_binks = []
for i in range(nbingkisan):
  ncemilan = int(input())
  setcemilan = []
  for j in range(ncemilan):
    cemil = int(input())
    setcemilan.append(cemil)

  set_binks.append(setcemilan)

# ndislike = 2
# dislike = [1,2]
# nbingkisan = 4
# set_binks = [[1,4],[1,2,3],[3,4],[3,5,7]]

# print('-------')
# print(ndislike)
# print(dislike)
# print(nbingkisan)
# print(set_binks)

def exist(el, set):
  cnt = 0
  for i in set:
    if (el-i==0):
      cnt += 1
      break
  return cnt

ans = 0
for i in set_binks:
  # print('...' * 20)
  cnt = 0
  # print(f'Eval i = {i}')
  for j in i:
    if (exist(j,dislike)>0):
      # print(f'Eval j = {j}')
      # print(f'Exist {j} in {dislike} = {exist(j,dislike)}')
      cnt += 1
      break
  if (cnt==0):
    ans += 1
  
# print(f'Final cnt = {ans}')
print(ans)
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 2908 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 3160 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 2908 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 2908 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 2908 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -