TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
(n, m) = map(int, input().split())
l = [set(list(map(int, input().split()))[1:]) for _ in range(n)]
len(l[0].intersection(*l[1:]))

(n, m) = map(int, input().split())
l = [set(list(map(int, input().split()))[1:]) for _ in range(n)]
print(len(l[0].intersection(*l[1:])))

Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = map(int, input().split())
l = [str(x) for x in range(1, m + 1)]
print(l)
i = 0
while (i < n):
    k = [str(x) for x in input().split()]
    del k[0]
    l = list(set(l) & set(k))
    i += 1
print(len(l))


n, m = map(int, input().split())
l = [str(x) for x in range(1, m + 1)]
i = 0
while (i < n):
    k = [str(x) for x in input().split()]
    del k[0]
    l = list(set(l) & set(k))
    i += 1
print(len(l))


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = (int(i) for i in input().split())
e = [[int(i) for i in input().split()] for i in range(n)]
dic = {}
for hobbies in e:
    for i in range(1,len(hobbies)+1):
        if hobbies[i] in dic:
            dic[hobbies[i]] +=1
        else:
            dic[hobbies[i]] = 0
everyoneLike = []
for key,num in dic.items():
    if num == n:
        everyoneLike.append(key)
print(len(everyoneLike))


n, m = (int(i) for i in input().split())
e = [[int(i) for i in input().split()] for i in range(n)]
dic = {}
for hobbies in e:
    for i in range(1,len(hobbies)):
        if hobbies[i] in dic:
            dic[hobbies[i]] +=1
        else:
            dic[hobbies[i]] = 1
everyoneLike = []
for key,num in dic.items():
    if num == n:
        everyoneLike.append(key)
print(len(everyoneLike))


Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n = int(input())
k = 0
alist = []
while k < n :
  a = list(map(int,input().split()))
  alist.append(a)
  k += 1
#
for blist in alist :
  b = blist[0]
  blist.remove(b)
#
anslist = []
ans = 0
i_roop = len(alist[0])
while i_roop >= 0 :
  if i_roop == 0 :
    break
  else:
    c = min(alist[0])
    for j in range(1,n) :
      if c in alist[j] :
        anslist.append("OK")
        if j == n-1 :
          if len(anslist) == n-1 :
            ans += 1
      else:
        if j == n-1 :
          if len(anslist) == n-1 :
            ans += 1
        break
    alist[0].remove(c)
  anslist = []
  i_roop += -1

print(ans)

n,m = map(int,input().split())
k = 0
alist = []
while k < n :
  a = list(map(int,input().split()))
  alist.append(a)
  k += 1
#
if n == 1 :
  print(len(alist[0])-1)
else:
  for blist in alist :
    b = blist[0]
    blist.remove(b)
#
  anslist = []
  ans = 0
  i_roop = len(alist[0])
  while i_roop >= 0 :
    if i_roop == 0 :
      break
    else:
      c = min(alist[0])
      for j in range(1,n) :
        if c in alist[j] :
          anslist.append("OK")
          if j == n-1 :
            if len(anslist) == n-1 :
              ans += 1
        else:
          if j == n-1 :
            if len(anslist) == n-1 :
              ans += 1
          break
      alist[0].remove(c)
    anslist = []
    i_roop += -1

if n != 1 :
  print(ans)

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
import itertools
N,M=map(int, input().split())
res=[]
for _ in range(N):
  data=list(map(int, input().split()))
  K=data.pop(0)
  A=data
  res.append(A)
print(res)
flatten_list = list(itertools.chain.from_iterable(res))
cnt=0
for i in range(1, M+1):
  if flatten_list.count(i) == N:
    cnt +=1
print(cnt)


import itertools
N,M=map(int, input().split())
res=[]
for _ in range(N):
  data=list(map(int, input().split()))
  K=data.pop(0)
  A=data
  res.append(A)
flatten_list = list(itertools.chain.from_iterable(res))
cnt=0
for i in range(1, M+1):
  if flatten_list.count(i) == N:
    cnt +=1
print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N,M=map(int, input().split())
List=[0]*M

for i in range(N):
  K=input().split()
  for k in range(K):
    List[int(k[K])-1]+=1
    
print(List.count(N))

N,M = map(int,input().split())
list_a = [0]*M
for i in range(N):
    k = input().split()
    for K in range(1,int(k[0])+1):
        list_a[int(k[K])-1] += 1
 
print(list_a.count(N))

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m=map(int,input().split())
ans=list(range(1,m+1))
print(ans)
for i in range(n):
    l=list(map(int,input().split()))[1:]
    ans=list(set(ans)&set(l))
print(len(ans))

n,m=map(int,input().split())
ans=list(range(1,m+1))
for i in range(n):
    l=list(map(int,input().split()))[1:]
    ans=list(set(ans)&set(l))
print(len(ans))

Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m = map(int,input().split())

a = [[int(i) for i in input().split()] for _ in range(n)]
k=[]
ans = 0

for i in range(n):
  k.append(a[i][0])

for j in range(1,m+1):
  x = 0
  for i in range(n):
    
    for w in range(1,(k[i]+1)):
      if a[i][w] == j:
        x +=1
        print(a[i][w])
    if x ==n:
      ans +=1

print(ans)

n,m = map(int,input().split())
x =[]
c = 0
for i in range(n):
  a = list(map(int,input().split()))
  a.pap(0)
  x.extend(a)
  
for j in range(1,m+1):
  if x.count(j) ==n:
    c +=1
    
print(c)

n,m = map(int,input().split())
x = []
c = 0
for i in range(n):
    a = list(map(int,input().split()))
    a.pop(0)
    x.extend(a)

for j in range(1,m+1):
    if x.count(j) == n:
        c += 1

print(c)



Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N,M = map(int,input().split())
list_list = [list(map(int,input().split())) for i in range(N)]

count = 0
for i in range(1,M+1):
  for list in list_list:
    if i in list:
      continue
    else:
      break
  count += 1

  
print(count)
      

N, M = map(int, input().split())
a = set(list(map(int, input().split()))[1:])
for i in range(N - 1):
    a &= set(list(map(int, input().split()))[1:])
print(len(a))


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
import numpy as np
n, m = map(int, input().split())
A = []
for _ in range(n):
  __ = input().split()
  A.append(np.array(__, dtype=int))
ans = []
for i in range(m):
  ans.append(i+1)
_ans = ans.copy()
for a in A:
  for i in range(len(ans)):
    if not ans[i] in a[1:]:
      _ans.remove(ans[i])
print(len(_ans))

import numpy as np
n, m = map(int, input().split())
A = []
for _ in range(n):
  __ = input().split()
  A.append(np.array(__, dtype=int))
ans = []
for i in range(m):
  ans.append(i+1)
_ans = ans.copy()
for a in A:
  for i in range(len(ans)):
    if not ans[i] in a[1:]:
      _ans.remove(ans[i])
  ans = _ans.copy()
  
print(len(_ans))

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))


n, m = map(int, input().split())

l = []
for i in range(n):
  a = [int(x) for x in input().split()]
  for j in range(1, a[0] + 1):
    l.append(a[j])

ans = 0
for i in range(m + 1):
  if l.count(i) == n:
    ans += 1

print(ans)

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = map(int, input().split())
flag = []
for _ in range(m): flag.append(True)
for _ in range(n):
    line = list(map(int, input()))
    for i in range(line[0]): flag[line[i+1]] = False
count = 0
for j in range(m):
    if(flag[j]): count += 1
print(count)

n, m = map(int, input().split())
flag = []
for _ in range(m): flag.append(0)
for _ in range(n):
    line = list(map(int, input().split()))
    for i in range(line[0]): flag[line[i+1]-1] += 1
count = 0
for j in range(m):
    if(flag[j] == n): count += 1
print(count)

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
from collections import deque
n, m = map(int, input().split())
a = [0]*m
for _ in range(n):
    A = deque(map(int, input().split()))
    k = A.popleft()
    if i == 0:
        S = set(A)
    else:
        S = S & set(A)
print(len(S))


from collections import deque
n, m = map(int, input().split())
a = [0]*m
for _ in range(n):
    A = deque(map(int, input().split()))
    k = A.popleft()
    if i == 0:
        S = set(A)
    else:
        S = S & set(A)
 
print(len(S))


from collections import deque
n, m = map(int, input().split())
a = [0]*m
for _ in range(n):
    A = deque(map(int, input().split()))
    k = A.popleft()
    if _ == 0:
        S = set(A)
    else:
        S = S & set(A)
print(len(S))



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N,M=(int(i) for i in input().split())
L=[]
for i in range(N):
  L.append([int(i) for i in input().split()])
s=set(L[0][1:L[0][0]])
for i in range(N):
  s=s&set(L[i][1:L[i][0]])
print(len(list(s))
   

N,M=(int(i) for i in input().split())
S=set(int(i+1) for i in range(M))

for i in range(N):
    L=[int(i) for i in input().split()]
    S=S&set(L[1:])
print(len(list(S)))

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int, input().split())
K = [0] * N
A = [list(map(int, input().split())) for i in range(N)]
count = 0
for i in range(1, M+1, 1): 
    likecount = 0
    for j in range(N): 
        print(A[j][0])
        for k in range(A[j][0]): 
            if A[j][k] == i:
                likecount += 1
    if likecount == N: 
        count += 1
print(count)


N, M = map(int, input().split())
likeset = set(range(1, M+1)) 
for _ in range(N):
    a, *b = map(int, input().split()) 
    likeset &= set(b) 
print(len(likeset))


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int, input().split())
t = [0 for i in range(M+1)]
for i in range(N):
  A = map(int, input().split())
  for j in range(1, A[0]+1):
    t[ A[j] ] += 1
ans = 0
for i in t:
  if i == N:
    ans += 1
print(ans)

N, M = map(int, input().split())
t = [0 for i in range(M+1)]
for i in range(N):
  A = list(map(int, input().split()))
  for j in range(1, A[0]+1):
    t[ A[j] ] += 1
ans = 0
for i in t:
  if i == N:
    ans += 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
from functools import reduce
from math import log
n, m = map(int, input().split())
f1 = lambda x, y: 1 << x | 1 << y
f2 = lambda x, y: x & y
lst = []
for i in range(n):
  tmplst = [int(i) for i in input().split()]
  tmp = reduce(f1, tmplst[1:])
  lst.append(tmp)
ret = reduce(f2, lst)
if ret:
  print(int(log(ret, 2)))
else:
  print(0)
  

n, m = map(int, input().split())
lst = []
for i in range(n):
  tmplst = [int(i) for i in input().split()]
  tmp = 0
  for item in tmplst[1:]:
    tmp |= 1 << item
  lst.append(tmp)
ret = lst[0]
for item in lst[1:]:
  ret &= item
if ret:
  s = sum(map(int, bin(ret)[2:]))
  print(s)
else:
  print(0)
  

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = [int(s) for s in input().split(' ')]
hypo = []

for _ in range(N):
  hypo.append([int(s) for s in input().split(' ')])

like_counts = [0] * M
for h in hypo:
  h_ = list(set(h))
  for i in h_:
    like_counts[i - 1] += 1

counts = 0
for i in like_counts:
  if i == N:
    counts += 1
print(counts)


N, M = [int(s) for s in input().split(' ')]
hypo = []

for _ in range(N):
  hypo.append([int(s) for s in input().split(' ')][1:])

like_counts = [0] * M
for h in hypo:
  h_ = list(set(h))
  for i in h_:
    like_counts[i - 1] += 1

counts = 0
for i in like_counts:
  if i == N:
    counts += 1
print(counts)


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int, input().split())

inputs = [[i for i in input().split()] for _ in range(N)]

ans = set(inputs[0])
for item in inputs:
    ans &= set(inputs[1:])

print(len(ans))


N, M = map(int, input().split())

inputs = [[i for i in input().split()] for _ in range(N)]

ans = set(inputs[0])
for item in inputs:
    ans &= set(item[1:])

print(len(ans))


Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m=map(int,input().split())
food=list(range(1,m+1))
for i in range(n):
    k,*a=map(int,input().split())
    food &= set(a)
print(len(food))

n,m=map(int,input().split())
food=set(range(1,m+1))
for i in range(n):
    k,*a=map(int,input().split())
    food &= set(a)
print(len(food))


Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N,M=map(int,input().split())
Set=set(range(1,M+1))
for i in range(N):
  Set=Set & set(map(int,input().split()))
print(len(Set))

N,M=map(int,input().split())
Set=set(range(1,M+1))
for i in range(N):
  Set=Set and set(map(int,input().split()))
print(len(Set))

N,M=map(int,input().split())
Set=set(range(1,M+1))
for i in range(N):
  Set=Set & set(list(map(int,input().split()))[1:])
print(len(Set))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N = int(input())
vectors = [input().split() for i in range(N)]

value = 0
converter = {
    'JPY' : 1,
    'BTC' : 380000
}
for v in vectors:
    x, u = v
    value += float(x) * converter.get(u)

print(value)

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

sumamry = [0] * M
for vec in vectors:
    ans = vec[1:]
    for a in ans:
        sumamry[a-1] += 1

ret = 0
for s in sumamry:
    if s == N:
        ret += 1

print(ret)

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N = list(map(int, input().split()))
array = list(map(int, input().split()))
array.remove(array[0])
dainyu = []
for i in range(0, N[0]-1):
    data = list(map(int, input().split()))
    dainyu = []
    for loop in range(1, data[0]-1):
        if (array.count(data[loop]) != 0) :
            dainyu.append(data[loop])
    array = dainyu
print(len(array))

N = list(map(int, input().split()))
array = list(map(int, input().split()))
array.remove(array[0])
dainyu = []
for i in range(0, N[0]-1):
    data = list(map(int, input().split()))
    dainyu = []
    for loop in range(1, data[0]+1):
        if (array.count(data[loop]) != 0) :
            dainyu.append(data[loop])
    array = dainyu
print(len(array))

Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
import numpy as np
N, M = map(int, input().split())

A = np.zeros((N,M))
for i in range(N):
    a = list(map(int, input().split()))
    a = a[1:]
    A[i, 0:len(a)] = a

for i in range(N):
    a = A[i]
    a = a[(a != 0) & (a < M)]
    if i == 0:
        s = set(list(a))
    else:
        _s = set(list(a))
    s &= _s

print(len(s))

N, M = map(int, input().split())
A = []
for i in range(N):
    A.append(list(map(int, input().split())))
    
s = set(list(A[0]))
for i in range(N):
    _s = set(A[i])
    s &= _s

print(len(s))

N, M = map(int, input().split())

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

s = set(A[0])
for i in range(1,N):
    _s = set(A[i])
    s &= _s
    
ans = len(s)-1
print(ans-1 if ans > 0 else 0)

import numpy as np
N, M = map(int, input().split())

A = np.zeros((N,M))
for i in range(N):
    a = list(map(int, input().split()))
    a = a[1:]
    A[i, 0:len(a)] = a

for i in range(N):
    a = A[i]
    a = a[(a != 0) & (a < M)]
    print(a)
    if i == 1:
        s = set(list(a))
    else:
        _s = set(list(a))
    s &= _s

print(len(s))

import numpy as np
N, M = map(int, input().split())

A = np.zeros((N,M))
for i in range(N):
    a = list(map(int, input().split()))
    A[i, 0:len(a)] = a

A = A[(A != 0) & (A < M)]
len(np.unique(A))

import numpy as np
N, M = map(int, input().split())

A = np.zeros((N,M))
for i in range(N):
    a = list(map(int, input().split()))
    a = a[1:]
    A[i, 0:len(a)] = a

for i in range(N):
    a = A[i]
    a = a[(a != 0) & (a < M)]
    if i == 1:
        s = set(list(a))
    else:
        _s = set(list(a))
    s &= _s

print(len(s))

import numpy as np
N, M = map(int, input().split())

A = np.zeros((N,M))
for i in range(N):
    a = list(map(int, input().split()))
    a = a[1:]
    A[i, 0:len(a)] = a

for i in range(N):
    a = A[i]
    a = a[(a != 0) & (a <= M)]
    if i == 0:
        s = set(list(a))
    else:
        _s = set(list(a))
        s &= _s

print(len(s))

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int,input().split())
ans = list(range(M))
for j in range(N):
  k = list(map(int,input().split()))
  del k[0]
  print(k)
  ans += k
  ans_2 = [a for a in set(ans) if ans.count(a) > N]
if N == 1:
  print(len(k))
else:
  print(len(ans_2))

N, M = map(int,input().split())
if N == 1:
    alpha = list(map(int,input().split()))
    print(len(alpha)-1)
    exit()
li = [list(map(int,input().split())) for i in range(N)]
for i in range(0,N,1):
    del li[i][0]
for i in range(1,N,1):
    if i == 1:
        ans = set(li[i-1]) & set(li[i])
    else:
        ans = set(ans) & set(li[i])
print(len(ans))


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = map(int,input().split())

li = []
for i in range(n):
    x = map(int,input().split())
    li.append(list(x)[1:])
#    print(li)


sumnum = 0 
for i in range(1, m+1):
    num = 0 
    for j in range(n):
        if i not in li[j]:
            num=0
            break
        num = 1 

    if num == 1:
        sumnum+=1
print(sumnum)
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~                       

n, m = map(int,input().split())

li = []
for i in range(n):
    x = map(int,input().split())
    li.append(list(x)[1:])
#    print(li)


sumnum = 0 
for i in range(1, m+1):
    num = 0 
    for j in range(n):
        if i not in li[j]:
            num=0
            break
        num = 1 

    if num == 1:
        sumnum+=1
print(sumnum)

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
###B - Foods Loved by Everyone
N, M = map(int, input().split())
kaito = []
for i in range(N):
    kaito.append(list(map(int, input().split())))

cnt = 0
for i in range(1, M+1):
    jlist = []
    for j in range(N):
        if i in kaito[j]:
            jlist.append(True)
        else:
            jlist.append(False)
    if all(jlist):
        cnt += 1
print(cnt)

###B - Foods Loved by Everyone
N, M = map(int, input().split())
kaito = []
for i in range(N):
    kaito.append([int(i) for i in input().split()])

print(kaito)
cnt = 0
for i in range(1, M+1):
    jlist = []
    for j in range(N):
        print(i,j)
        if i in kaito[j][1:]:
            jlist.append(True)
        else:
            jlist.append(False)
    if all(jlist):
        cnt += 1
    print(jlist)
print(cnt)

###B - Foods Loved by Everyone
N, M = map(int, input().split())
kaito = []
for i in range(N):
    kaito.append([int(i) for i in input().split()])

cnt = 0
for i in range(1, M+1):
    jlist = []
    for j in range(N):
        if i in kaito[j][1:]:
            jlist.append(True)
        else:
            jlist.append(False)
    if all(jlist):
        cnt += 1
        
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = list(map(int, input().split()))
a = []
for i in range(n) :
    a.extend(list(map(int, input().split()))[1:])
print(a)
b = []
for i in range(1, m + 1) :
    if a.count(i) == n :
        b.append(i)
print(len(b))


n, m = list(map(int, input().split()))
a = []
for i in range(n) :
    a.extend(list(map(int, input().split()))[1:])
b = []
for i in range(1, m + 1) :
    if a.count(i) == n :
        b.append(i)
print(len(b))


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
import collections
N,M=map(int,input().split())

counter=collections.defaultdict
for _ in range(N):
  text = list(input().split())
  for x in text[1:]:
    counter[x]+=1
ans=0
for _ in counter:
  if counter[x]== N:
    ans+=1
print(ans)

import collections
N,M=map(int,input().split())

counter=collections.defaultdict(int)
for _ in range(N):
  text = list(input().split())
  for x in text[1:]:
    counter[x]+=1
ans=0
for _ in counter:
  if counter[x]== N:
    ans+=1
print(ans)

import collections
N,M=map(int,input().split())

counter=collections.defaultdict(int)
for _ in range(N):
  text = list(input().split())
  for x in text[1:]:
    counter[x]+=1
ans=0
for x in counter:
  if counter[x]== N:
    ans+=1
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m = map(int,input().split())
a = []
for i in range(n):
    a.append(list(map(int,input().split())))

b = [x[1:] for x in a ]

c = []
for j in range(1,31):
    for k in range(n):
        if j in b[k]:
            c.append(j)

d = [x for x in set(c) if c.count(x) == n]

n,m = map(int,input().split())
a = []
for i in range(n):
    a.append(list(map(int,input().split())))

b = [x[1:] for x in a ]

c = []
for j in range(1,31):
    for k in range(n):
        if j in b[k]:
            c.append(j)

d = [x for x in set(c) if c.count(x) == n]

print(len(d))

Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m=map(int,input().split())
like=[]
for i in range(n):
    like+=list(map(int,input().split()))
ans=0
for i in range(1,m+1):
    if like.count(i)==n:
        ans+=1
print(ans)

n,m=map(int,input().split())
like=[]
for i in range(n):
    like+=list(map(int,input()))
print(len(set(like)))

n,m=map(int,input().split())
like=[]
for i in range(n):
    k,*a=map(int,input().split())
    like+=a
ans=0
for i in range(1,m+1):
    if like.count(i)==n:
        ans+=1
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N,M = map(int,input().split())
K=[]
ans=0
for _ in range(N):
  K+=[input().split()]
S=set(K)
for s in S:
  if K.count(s)==N:
    ans+=1
print(ans)

N,M = map(int,input().split())
K=[]
ans=0
for _ in range(N):
  K+=input().split()[1:]
S=set(K)
for s in S:
  if K.count(s)==N:
    ans+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int, input().split())

from collections import defaultdict
fav = defaultdict(int)
for i in range(N):
    KA = list(map(int, input().split()))
    for i in range(1, KA[0]+1):
        fav[str(KA[i])] += 1

for i in sorted(fav.keys()):
    if fav[i] == N:
        print(i)

N, M = map(int, input().split())

from collections import defaultdict
fav = defaultdict(int)
for i in range(N):
    KA = list(map(int, input().split()))
    for i in range(1, KA[0]+1):
        fav[str(KA[i])] += 1

ans = 0
for i in fav.keys():
    if fav[i] == N:
        ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = list(map(int,input().split()))
k = [list(map(int,input().split())) for i in range(n)]

dic = {}
for i in range(n):
    for j in range(1, k[i][0]+1):
        if k[i][j] in dic:
            dic[k[i][j]] += 1
        else:
            dic[k[i][j]] = 1

print(dic)
ans = 0
for i in dic.values():
    if n == i:
        ans += 1
print(ans)

n, m = list(map(int,input().split()))
k = [list(map(int,input().split())) for i in range(n)]

dic = {}
for i in range(n):
    for j in range(1, k[i][0]+1):
        if k[i][j] in dic:
            dic[k[i][j]] += 1
        else:
            dic[k[i][j]] = 1

ans = 0
for i in dic.values():
    if n == i:
        ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
import sys

v = []
for line in sys.stdin:
  v.append([int(l) for l in line.split()])

n, m = v[0]
min_k = -1
min_idx = -1
for idx, line in enumerate(v[1:]):
  if min_k == -1 or min_k > line[0]:
    min_k = line[0]
    min_idx = idx + 1

count = 0
min_v = line[min_idx, 1:]
for min_v_v in min_v:
	if n == sum(min_v_v in v[1:,1:]):
      count+=1
print(count)

import sys

v = []
for line in sys.stdin:
    v.append([int(l) for l in line.split()])

n = v[0][0]
m = v[0][1]

a = None
for line in v[1:]:
  if a == None:
    a = line[1:]
  else:
    c = []
    for b in a:
      if b in line[1:]:
        c.append(b)
    a = c
print(len(a))

Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N,M = map(int, input().split())

A=[]
for i in range(N):
  x = [int(i) for i in input().split()]
  A = A + x[1:]

ans = 0
from collections import Counter
for k,v in Counter(A).items():
  print(k,v)
  if v==N: ans += 1

print(ans)


N,M = map(int, input().split())

A=[]
for i in range(N):
  x = [int(i) for i in input().split()]
  A = A + x[1:]

ans = 0
from collections import Counter
for k,v in Counter(A).items():
  # print(k,v)
  if v==N: ans += 1

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int, input().split())
List = list(range(1,M))
anser = []
def judge(N,M,List,anser):
  for i in range(N):
    L = list(map(int, input().split()))
    anser.extend(L)
    anser = list(set(anser))
    print(anser)
  print(M - len(anser))
judge(N,M,List,anser)
    

N, M = map(int, input().split())
List = list(range(1,M))
anser = []
def judge(N,M,List,anser):
  for i in range(N):
    L = list(map(int, input().split()))
    anser.extend(L)
    anser = list(set(anser))
    print(anser)
  print(len(anser))
judge(N,M,List,anser)

N, M = map(int, input().split())
List = list(range(1,M))
anser = []
def judge(N,M,List,anser):
  for i in range(N):
    L = list(map(int, input().split()))
    del L[0]
    if i==0:
      anser.extend(L)
    else:
      anser = list(set(L)&set(anser))
    
    
  print(len(anser))
judge(N,M,List,anser)
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
from collections import defaultdict


n, m = map(int, input().split())
d = defaultdict(int)
for i in range(n):
    tmp = map(int, input().split())
    for a in tmp[1:]:
        d[a] += 1
cnt = 0
for value in range(d.values()):
    if value == n:
        cnt += 1
print(cnt)

from collections import defaultdict


n, m = map(int, input().split())
d = defaultdict(int)
for i in range(n):
    tmp = list(map(int, input().split()))
    for a in tmp[1:]:
        d[a] += 1
cnt = 0
for value in range(d.values()):
    if value == n:
        cnt += 1
print(cnt)


from collections import defaultdict


n, m = map(int, input().split())
d = defaultdict(int)
for i in range(n):
    tmp = list(map(int, input().split()))
    for a in tmp[1:]:
        d[a] += 1
cnt = 0
for value in d.values():
    if value == n:
        cnt += 1
print(cnt)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n, m = int(input())

S = set(range(1, m+1))

for i in range(n):
  K, *a = map(int, input().split())
  S = S & set(A)

print(len(S))

n, m = map(int, input().split())
 
S = set(range(1, m+1))
 
for i in range(n):
  K, *a = map(int, input().split())
  S = S & set(A)
 
print(len(S))

n, m = map(int, input().split())

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

x = [True] * m

for i in a:
    y = i[0]
    xx = [False] * m
    for j in range(y):
        x[i[j + 1]] = True
    for j in range(m):
        if xx[j] == False:
            x[j] = False

print(sum(x))


n, m = int(input())
a = [list(map(int, input().split())) for i in range(n)]

x = [True] * m

for i in a:
  y = i[0]
  xx = [False] * m
  for j in range(y):
    x[i[j+1]] = True
  for j in range(m):
    if xx[j] = False:
      x[j] = False

print(sum(x))

n, m = int(input())
a = [list(map(int, input().split())) for i in range(n)]

x = [True] * m

for i in a:
    y = i[0]
    xx = [False] * m
    for j in range(y):
        x[i[j + 1]] = True
    for j in range(m):
        if xx[j] == False:
            x[j] = False

print(sum(x))

n, m = map(int, input().split())

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

x = [True] * m

for i in a:
    y = i[0]
    xx = [False] * m
    for j in range(y):
        xx[i[j + 1] - 1] = True
    for j in range(m):
        if xx[j] == False:
            x[j] = False

print(sum(x))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
inp = input().split()
n = int(inp[0])
m = int(inp[1])
favorite = [] 
for i in range(n):
    tmp = []
    tmp_inp = input().split()
    k = int(tmp_inp[0])
    for i in range(k):
        tmp.append(int(tmp_inp[i+1]))
    hyou.append(set(tmp))


def intersect_set(list):  
    result = list[0]
    for i in range(len(list)-1):
        result = result.intersection(list[i+1])
    return result

print(len(intersect_set(hyou)))


inp = input().split()
n = int(inp[0])
m = int(inp[1])
favorite = [] 
for i in range(n):
    tmp = []
    tmp_inp = input().split()
    k = int(tmp_inp[0])
    for i in range(k):
        tmp.append(int(tmp_inp[i+1]))
    favorite.append(set(tmp))


def intersect_set(list):  
    result = list[0]
    for i in range(len(list)-1):
        result = result.intersection(list[i+1])
    return result

print(len(intersect_set(favorite)))


Verdicts: Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
N, M = map(int, input().split())

like = list(map(int, input().split()))
all_like = set()
for l in like:
	all_like.add(l)
    
for i in range(N-1):
  like = list(map(int, input().split()))
  for l in like:
    if l not in all_like:
      all_like.remove(l);
print(len(all_like))

N, M = map(int, input().split())

like = list(map(int, input().split()))
all_like = set()
for l in like:
	all_like.add(l)
for i in range(N):
  like = list(map(int, input().split()))
  for l in like:
    if l not in all_like:
      all_like.remove(l);
print(len(all_like))

import copy

N, M = map(int, input().split())

like = list(map(int, input().split()))
like.pop(0)
all_like = set()
for l in like:
	all_like.add(l)
    
for i in range(N-1):
  like = list(map(int, input().split()))
  like.pop(0)
  tmp = copy.deepcopy(all_like)
  for l in all_like:
    if l not in like:
      tmp.remove(l);
  all_like = tmp
print(len(all_like))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Katsusando loves omelette rice.  Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.  To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not.  The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food.  Find the number of the foods liked by all the N people.

Submission attempts (in order):
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
  k=list(map(int,input().split()))
  for j in range(1,k[0]):
    a[k[j]-1]=1
    
print(m.count(0))

n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
  b=list(map(int,input().split()))
  for i in range(b[0]):
    a[b[i+1]-1]+=1
ans=0
for i in a:
  if i==n:
    ans+=1
print(ans)

Verdicts: Runtime Error

Accepted