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):
import collections as co
n,m=map(int,input().split())
l=[]
for i in range(n):
    j,*k=map(int,input().split())
    l.extend(k)
for p,q in co.Counter(l).items():
    if q==n:print(p)

import collections as co
n,m=map(int,input().split())
l=[]
for i in range(n):
    j,*k=map(int,input().split())
    l.extend(k)
count_num=0
for p,q in co.Counter(l).items():
    if q==n:count_num+=1
print(count_num)

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

(sn, sm) = sys.stdin.readline().split()
n = int(sn)
m = int(sm)

flg = [0 for j in range(m)]
for i in range(n):
  sa = sys.stdin.readline().split()
  for saj in sa:
    aj = int(saj)
    flg[aj - 1] += 1

suma = 0
for sumaj in flg:
  if sumaj == n:
    suma += 1
print(suma)

import sys

(sn, sm) = sys.stdin.readline().split()
n = int(sn)
m = int(sm)

flg = [0 for j in range(m)]
for i in range(n):
  sa = sys.stdin.readline().split()
  for saj in sa[1:]
    aj = int(saj)
    flg[aj - 1] += 1

suma = 0
for sumaj in flg:
  if sumaj == n:
    suma += 1
print(suma)

import sys

(sn, sm) = sys.stdin.readline().split()
n = int(sn)
m = int(sm)

flg = [0 for j in range(m)]
for i in range(n):
  sa = sys.stdin.readline().split()
  if len(sa) > 1:
	  for saj in sa[1:]:
    	aj = int(saj)
    	flg[aj - 1] += 1

suma = 0
for sumaj in flg:
  if sumaj == n:
    suma += 1
print(suma)

import sys

(sn, sm) = sys.stdin.readline().split()
n = int(sn)
m = int(sm)

flg = [0 for j in range(m)]
for i in range(n):
  sa = sys.stdin.readline().split()
  if len(sa) > 1:
	  for saj in sa[1:]
    	aj = int(saj)
    	flg[aj - 1] += 1

suma = 0
for sumaj in flg:
  if sumaj == n:
    suma += 1
print(suma)

import sys

(sn, sm) = sys.stdin.readline().split()
n = int(sn)
m = int(sm)

flg = [0 for j in range(m)]
for i in range(n):
  sa = sys.stdin.readline().split()
  for saj in sa:
    aj = int(saj)
    flg[aj - 1] += 1

suma = 0
for sumaj in range(flg):
  if sumaj == n:
    suma += 1
print(suma)

import sys

(sn, sm) = sys.stdin.readline().split()
n = int(sn)
m = int(sm)

flg = [0 for j in range(m)]
for i in range(n):
  sa = sys.stdin.readline().split()
  if len(sa) > 1:
    for saj in sa[1:]:
      aj = int(saj)
      flg[aj - 1] += 1

suma = 0
for sumaj in flg:
  if sumaj == n:
    suma += 1
print(suma)

Verdicts: Wrong Answer

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):
n,m=map(int,input().split())
s0 = set(input().split())
for _ in range(n-1):
  s = set(input(split()))
  s0 &= s
print(len(s0))

n,m=map(int,input().split())
k,*s0=map(int,input().split())
s0 = set(s0)
for _ in range(n-1):
  k,*s = map(int,input().split())
  s = set(s)
  s0 &= s
print(len(s0))

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())
lovelist=[]
count=0
for _ in range(n):
    a=list(map(int,input().split()))
    a=set(a[1:])
    lovelist.append(a)
for i in range(n-1):
    lovelist[i+1]=lovelist[i]&lovelist[i+1]
    print(len(lovelist[-1]))

n,m=map(int,input().split())
lovelist=[]
for _ in range(n):
    a=set(sorted(list(map(int,input().split()))))
    lovelist.append(a)
for i in range(n-1):
    lovelist[i+1]=lovelist[i]&lovelist[i+1]
print(len(lovelist[2]))

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


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())
A = [[0]*M]*N
for i in range(N):
    A[i] = list(map(int,input().split()))
    del A[i][0]

I = [True]*(M)

for j in range(1,M):
    for ki in range(N):
        if not (j in A[ki]):
            I[j-1] = False

print(I.count(True))

N,M = map(int,input().split())
A = [[0]*M]*N
for i in range(N):
    A[i] = list(map(int,input().split()))
    del A[i][0]

I = [True]*(M)

for j in range(1,M+1):
    for ki in range(N):
        if not (j in A[ki]):
            I[j-1] = False

print(I.count(True))

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=[0]*(M+1)
cnt=0
for i in range(N):
  S=list(map(int,input().split()))
  for j in range(1,S[0]+1):
    A[S[j]]+=1
    #print(A)
print(A)
for i in range(len(A)):
  if A[i]>=N:
    cnt+=1
print(cnt)

N,M=map(int,input().split())
A=[0]*(M+1)
cnt=0
for i in range(N):
  S=list(map(int,input().split()))
  for j in range(1,S[0]+1):
    A[S[j]]+=1
    #print(A)
#print(A)
for i in range(len(A)):
  if A[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):
a = [list(map(int,input().split())) for i in range(n)]
b = set()
for i in range(n):
    a[i].pop(0)
b = set(a[0])
for i in range(n):
    c = set(a[i])
    b = b&c
print(len(list(b)))

n,m = map(int ,input().split())
a = [list(map(int,input().split())) for i in range(n)]
b = set()
for i in range(n):
    a[i].pop(0)
b = set(a[0])
for i in range(n):
    c = set(a[i])
    b = b&c
print(len(list(b)))

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):
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:59:16 2019

@author: doppe
"""

N, M = map(int, input().split())
likeList = []

for i in range(0, N):
    L = [int(i) for i in input().split()]
    likeListTmp = []
    if (i == 0):
        likeList = L
    else:
        for j in range(1, L[0] + 1):
            if (L[j] in likeList):
                likeListTmp.append(L[j])
        likeList = likeListTmp

print(len(likeList))

# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:59:16 2019

@author: doppe
"""

N, M = map(int, input().split())
likeList = []

for i in range(0, N):
    L = [int(i) for i in input().split()]
    likeListTmp = []
    if (i == 0):
        likeList = L
    else:
        for j in range(1, L[0] + 1):
            if (L[j] in likeList):
                likeListTmp.append(L[j])
        likeList = likeListTmp

print(likeList)

# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:59:16 2019

@author: doppe
"""

N, M = map(int, input().split())
likeList = []

for i in range(0, N):
    L = [int(i) for i in input().split()]
    likeListTmp = []
    if (i == 0):
        likeList = L[1 : L[0] + 1]
    else:
        for j in range(1, L[0] + 1):
            if (L[j] in likeList):
                likeListTmp.append(L[j])
        likeList = likeListTmp

print(len(likeList))

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 = map(int, input().split())
a = list(map(int, input().split()))
K_past = a[0]
A_past = a[1:]
  

for n in range(1,N):
  a = list(map(int, input().split()))
  K = a[0]
  A = a[1:]
  
  for i in range(K):
    l = []
    if A[i] in A_past:
      l.append(A[i])
    A_past = l
    

N,M = map(int, input().split())
a = list(map(int, input().split()))
K_past = a[0]
A_past = a[1:]
  

for n in range(1,N):
  a = list(map(int, input().split()))
  l = []
  K = a[0]
  A = a[1:]
  
  for i in range(K):
    if A[i] in A_past:
      l.append(A[i])
  A_past = l
    
print(len(A_past))

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,c=[],[]
for i in range(m):
  c.append(i+1)
i=0
while i<n:
  k,a=input().split()
  for j in range(len(c)):
    if c[j] not in a:
      c.remove(c[j])
      j-=1
    j +=1
  a=[]
print(len(c))

N, M = map(int, input().split())
q = [0 for _ in range(M)]
for i in range(N):
    KA = list(map(int, input().split()))
    for j in range(1, KA[0] + 1):
        q[KA[j] - 1] += 1
print(q.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())
count=[0]*m
ans=0
list=[]
for i in range(n):
  list.append(list(map(int,input().split())))
  for j in range(1,list[i][0]+1):
    count[j]+=1
for i in range(m):
  if count[i]==n:
    ans+=1
print(ans)

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

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

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


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

Verdicts: 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):
n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(len([i for i in kdict.values() if i == n]))


n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    kdict = {}
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(len([i for i in kdict.values() if i == n]))


n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    kdict = {i:0 for i in range(1,m+1)}
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(sum([i for i in kdict.items() if i == n]))


n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    kdict = {i:0 for i in range(1,m+1)}
    for _ in range(n):
        for i in map(int, input().split()[1:]):
            kdict[i] += 1
    print(sum([i for i in kdict.items() if i == n]))


n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    kdict = {i:0 for i in range(1,m+1)}
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(len([i for i in kdict.values()() if i == n]))


n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    kdict = {i:0 for i in range(1,m+1)}
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(len([i for i in kdict.values() if i == n]))


Verdicts: Runtime Error

Runtime Error

Wrong Answer

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())
l = [list(map(int, input().split())) for i in range(N)]
m = []
for i in range(1, l[0][0] + 1):
    m.append(l[0][i])
for i in range(1, N):
    for j in m:
        
        if l[i][1:i[0] + 1].count(j) == 0:
            m.remove(j)
            
print(len(m))

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

m = [0] * 30
for i in range(n):
    a = list(map(int, input().split()))
    for j in range(1, len(a)):
        m[a[j] - 1] += 1

print(m.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())
c = [0] * m
for i in range(n):
    k, *a = map(int, input().split())
    print(a)
    for e in a:
        c[e-1] += 1

ans = 0
for i in range(m):
    if c[i] == n:
        ans += 1

print(ans)

n, m = map(int, input().split())
c = [0] * m
for i in range(n):
    k, *a = map(int, input().split())
    # print(a)
    for e in a:
        c[e-1] += 1

ans = 0
for i in range(m):
    if c[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=map(int,input().split())
k=[]
a=[]
for i in range(n):
  b=list(map(int,input().split()))
  k.append(b[0])
  a.append(b[1:])
d={}
for i in range(n):
  for j in range(k[i]):
    if a[i][j] not in d:
      d[a[i][j]]=1
    else:
      d[a[i][j]]+=1
nd=list(d.values())
cnt=0
for i in range(len(nd)):
  if nd[i]==n:
    cnt+=1
print(cnt

n,m=map(int,input().split())
k=[]
a=[]
for i in range(n):
  b=list(map(int,input().split()))
  k.append(b[0])
  a.append(b[1:])
d={}
for i in range(n):
  for j in range(k[i]):
    if a[i][j] not in d:
      d[a[i][j]]=1
    else:
      d[a[i][j]]+=1
nd=list(d.values())
cnt=0
for i in range(len(nd)):
  if nd[i]==n:
    cnt+=1
print(cnt)


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):
#!/usr/bin/python
# coding: UTF-8
n,m = map(int,input().split())

res = [0 for _ in range(m)]

for i in range(n):
  for j in list(map(int,input().split()))[1:]:
    res[j-1] += 1

print(sum([res[i]==m for i in range(m)]))

#!/usr/bin/python
# coding: UTF-8
n,m = map(int,input().split())

res = [0 for _ in range(m)]

for i in range(n):
  res_tmp = [0 for _ in range(m)]
  for j in list(map(int,input().split()))[1:]:
    res[j-1] += 1
  print(res)

print(sum([res[i]==n for i in range(m)]))

#!/usr/bin/python
# coding: UTF-8
n,m = map(int,input().split())

res = [1 for _ in range(m)]

for i in range(n):
  for j in list(map(int,input().split()))[1:]:
    res[j-1] = 0

print(m-sum(res))


#!/usr/bin/python
# coding: UTF-8
import numpy as np

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

res = np.array([1 for _ in range(m)])
print(res)

res_init = np.array([-1 for _ in range(m)])
print(res_init)

for i in range(n):
  res_tmp = res_init
  for j in list(map(int,input().split()))[1:]:
    res_init[j-1] = 0
  res += res_tmp
  print(res)

print(sum(res))

#!/usr/bin/python
# coding: UTF-8
n,m = map(int,input().split())

res = [0 for _ in range(m)]

for i in range(n):
  for j in list(map(int,input().split()))[1:]:
    res[j-1] += 1

print(sum([res[i]==n for i in range(m)]))

Verdicts: Wrong Answer

Wrong Answer

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 = map(int,input().split())
A = list[map(int,input().split()) for i in range(n)]
ans = {i+1 for i in range(m)}
for a in A:
    ans = ans & set(a[1:])
print(len(ans))

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

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

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

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

food =[0]*(m+1)

for i in range(n):
  num = list(map(int,input().split()))
  for j in range(1,num[0]):
    food[num[j]] += 1

print(food.count(n))

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

food =[0]*(m+1)

for i in range(n):
  num = list(map(int,input().split()))
  for j in range(1,num[0]+1):
    food[num[j]] += 1

print(food.count(n))

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())
result = [0] * N

for i in range(N):
    K, A = list(map(int, input().split()))
    K = s[0]
    A = s[1:]
    for j in range(K):
        result[A[j]-1] = result[A[j]-1] + 1

print(result.count(N))


N, M = map(int, input().split())
result = [0] * M

for i in range(N):
    s = list(map(int, input().split()))
    K = s[0]
    A = s[1:]
    for j in range(K):
        result[A[j]-1] = result[A[j]-1] + 1

print(result.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):
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}



n, m = map(int, input().split())
con = []
for i in range(n):
    k = [int(x) for x in input().split()]
    for j in range(1, k[0]+1):
        con.append(k[j])
ans = 0
print(con)
for i in range(m):
    if con.count(i+1) == n:
        ans += 1
print(ans)


import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}



n, m = map(int, input().split())
con = []
for i in range(n):
    k = [int(x) for x in input().split()]
    for j in range(1, k[0]+1):
        con.append(k[j])
ans = 0
for i in range(m):
    if con.count(i+1) == 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())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j-1] - 1] += 1
print(foodlike.count(n))


n,m = map(int,input().split())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j-1]] += 1
print(foodlike.count(n))

n,m = map(int,input().split())
foodlike = [0]*m
for i in range(n):
    data = list(map(int,input().split()))
    for j in range(data[0]):
        foodlike[data[j+1] - 1] += 1
print(foodlike.count(n))

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())
like_set = {}
for i in range(1,M+1):
    like_set = like_set | {i}
for i in range(N):
    k_a = input().split()
    a = k_a[1:]
    like_set = set(a) & like_set
print(len(like_set))


N, M = map(int, input().split())
like_set = {}
for i in range(1, M+1):
    like_set.add(i)
for i in range(N):
    like = input().split()
    like = set(like[1:])
    like_set = like_set & like
print(len(like_set))


N, M = map(int, input().split())
like_set = {0}
for i in range(1, M+1):
    like_set.add(i)
for i in range(N):
    like = list(map(int,input().split()))
    like = set(like[1:])
    like_set = like_set & like
print(len(like_set))


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())
res = [[False for _ in range(m)] for _ in range(n)]

for i in range(n):
    o = list(map(int, input().split()))
    for j, x in enumerate(o):
        if j != 0:
            res[i][x - 1] = True

ans = 0
res = list(zip(*res))

for i, x in enumerate(res):
    print(x)
    if all(x):
        ans += 1

print(ans)


n,m=map(int,input().split());a=[0]*m
for _ in a:
  _,*o=map(int,input().split())
  for x in o:res[x-1]+=1
print(a.count(n))

n,m=map(int,input().split());res=[0]*m
for _ in [0]*n:
  _,*o=map(int,input().split())
  for x in o:
    res[x-1]+=1
ans=res.count(n)
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):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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


import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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


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

dic = {}
for i in range(0,n):
    k = list(map(int,input().split()))
    for j in range(1,len(k)):
        if k[j] in dic:
            dic[k[j]] += 1
        else:
            dic[k[j]] = 1
        
res = 0
for key,value in dic.items():
    if value == n:
        res+=1
res

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

dic = {}
for i in range(0,n):
    k = list(map(int,input().split()))
    for j in range(1,len(k)):
        if k[j] in dic:
            dic[k[j]] += 1
        else:
            dic[k[j]] = 1
        
res = 0
for key,value in dic.items():
    if value == n:
        res+=1
print(res)

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):
from operator import add

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

count = 0
for num in li:
    if n == li.count(num):
        count += 1
print(count)

from operator import add

n, m = map(int, input().split())
li = []
for i in range(n):
    li.append(list(map(int, input().split())))
    del li[i][0]
li = sum(li, [])
li_2 = list(set(li))
count = 0
for num in li_2:
    if n == li.count(num):
        count += 1
print(count)

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):
print(6)

print(7)

import random
print(random.randint(1,30))

print(30)

print(3)

print(5)

print(0)

print(4)

print(10)

import random
print(random.randint(0,30))

print(8)

print(2)

n, m = map(int, input().split())
k = list(map(int, input().split()))
del k[0]
ans = set(k)

for i in range(n-1):
    x = list(map(int, input().split()))
    del x[0]

    x = set(x)
    ans = ans & x

ans = list(ans)

print(len(ans))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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):
import numpy as np
n,m = map(int,input().split())
a=np.zeros(m,dtype=int64)
for i in range(n):
    li = list(map(int,input().split()))
    for j in range(li[0]):
        a[li[j+1]-1]=a[li[j+1]-1]+1
ans=0
for i in range(m):
    if a[i]==n:
        ans=ans+1
print(ans)

import numpy as np
n,m = map(int,input().split())
a=np.zeros(m,dtype=np.int64)
for i in range(n):
    li=[]
    li = list(map(int,input().split()))
    
    for j in range(li[0]):
        a[li[j+1]-1]=a[li[j+1]-1]+1
        
ans=0
for i in range(m):
    if a[i]==n:
        ans=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 = list(map(int, input().split())) 
answer=[]
a = []
food_list=[]
for i in range(N):
    answer=list(map(int, input().split()))
    if i==0:
        food_list=answer
    else:
        like_food=[]
        for food in answer[1:-1]:
            if (food in like_food)==False:
                if (food in food_list)==True:
                    like_food.append(food)
        food_list=like_food
print(len(food_list))

N, M = list(map(int, input().split())) 
answer=[]
a = []
food_list=[]
for i in range(N):
    answer=list(map(int, input().split()))
    if i==0:
        food_list=answer[1:]
    else:
        like_food=[]
        for food in answer[1:]:
            if (food in like_food)==False:
                if (food in food_list)==True:
                    like_food.append(food)
        food_list=like_food
print(len(food_list))

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())
ans = set(list(range(1, m+1)))
for i in range(n):
  k, *a = map(int, input().split())
  ans &= set(a)
  
print(ans)

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

lst = list(range(1, m+1)):

for _ in range(n):
  for i in lst:
    if i not in list(map(int, input().split()))[1:]:
      lst.pop(lst.index(i))
print(len(lst))

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

lst = list(range(1, m+1)):

for _ in range(n):
  for i in lst:
    if i not in list(map(int, input().split()))[1:]:
      lst.pop(lst.index(i))
print(len(lst))

n, m = map(int, input().split())
s = set(range(1, m+1))

for i in range(n):
  c, *a = map(int, input().split())
  s &= set(a)
  
print(len(s))

Verdicts: Wrong Answer

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())
s = set(str(i) for i in range(m))
for _ in range(n):
  s = s & set(input().split())
print(len(s))

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

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):
# 2019-11-12 15:53:47(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    nm, *lines = sys.stdin.readlines()
    n, m = [int(x) for x in nm.split()]
    likes = [[int(x) for x in line.split()] for line in lines]
    menu = set(range(1, m+1))
    res = menu
    print(res)
    for i in range(n):
        res &= set(likes[i][1:])
        print(res)
    
    print(len(res))

if __name__ == "__main__":
    main()


import sys

n, m = map(int, sys.stdin.readline().split())
g = [[int(x) for x in sys.stdin.readline().split()[1:]] for _ in range(n)]

def main():
    res = set(range(1, m+1))
    for a in g:
        res &= set(a)
    
    return len(res)

if __name__ == '__main__':
    ans = main()
    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())
S=set(range(1,m+1))
for i in range(n):
    K,*A=map(int,input().split())
    print(A)
    S&=set(A)
print(len(S))


n,m=map(int,input().split())
l=[]
for _ in range(n):
    k,*s=input().split()
    l+=s
se=set(l)
a=0
for i in se:
    c=l.count(i)
    if c==n:
        a+=1
print(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):
N, M = map(int, input().split())
foodlist = [0 for i in range(M)]
for i in range(N):
    food = list(map(int, input().split()))
    food.pop(0)
    for items in food:
        foodlist[items-1]+=1
cnt = 0
print(foodlist)
for i in range(M):
    if(foodlist[i] == N): cnt+=1
print(cnt)

N, M = map(int, input().split())
foodlist = [0 for i in range(M)]
for i in range(N):
    food = list(map(int, input().split()))
    food.pop(0)
    for items in food:
        foodlist[items-1]+=1
cnt = 0

for i in range(M):
    if(foodlist[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())
import sys
ans = 0
lst = []
kari = []
for i in range(N):
    if i == 0:
        lst += list(map(int, input().split()))
        lst = lst[1:]
        print (lst)
    else:
        if lst == []:
            print (0)
            sys.exit()
        else:      
            kari = list(map(int, input().split()))
#            print ('kari ', kari)
            sakujo = []
            for j in lst:
                if j in kari[1:]:
                    pass
                else:
                    sakujo += [j]

#                    print (j)
            for k in sakujo:
                lst.remove(k)

#        print ('lst ', lst)
        if lst == []:
            print (0)
            sys.exit()

#print (lst)
ans = len(lst)
print (ans)

N, M = map(int, input().split())
import sys
ans = 0
lst = []
kari = []
for i in range(N):
    if i == 0:
        lst += list(map(int, input().split()))
        lst = lst[1:]
#        print (lst)
    else:
        if lst == []:
            print (0)
            sys.exit()
        else:      
            kari = list(map(int, input().split()))
#            print ('kari ', kari)
            sakujo = []
            for j in lst:
                if j in kari[1:]:
                    pass
                else:
                    sakujo += [j]

#                    print (j)
            for k in sakujo:
                lst.remove(k)

#        print ('lst ', lst)
        if lst == []:
            print (0)
            sys.exit()

#print (lst)
ans = len(lst)
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())
k = [list(map(int, input().split())) for i in range(n)]
result = 0
answer = 0
for i in range(1,m + 1):
    for j in range(n):
        K = k[j]
        for v in range(1,K[0] + 1):
            if K[v] == i:
                result += 1
    if result == n:
        answer += 1
print(answer)


import collections

N,M = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]
favorite = []
count = 0

for i in range(1,A[0][0]+1):
    favorite.append(A[0][i])
for j in range(1,N):
    for k in range(1, A[j][0]+1):
        if A[j][k] in favorite:
            favorite.append(A[j][k])

a = collections.Counter(favorite)
for key,value in a.items():
    if value == N:
        count += 1
print(count)


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


def main():
	N,M=map(int,input().split())
	like=[0]*M
	for _ in range(N):
    	K,*A=map(int,input().split())
    	for num in A:
        	like[num-1]+=1
print(like.count(N))

if __name__=='__main__':
    main()




     


def main():
    N,M=map(int,input().split())
    like=[0]*M
    for _ in range(N):
        K,*A=map(int,input().split())
        for num in A:
            like[num-1]+=1
    print(like.count(N))

if __name__=='__main__':
    main()




     


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(" ")) 
S=set(range(1,m+1))
for i in range(n):
    K, *A = map(int, input().split(" "))　
    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 &=set(A)
print(len(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,K = map(int,input().split())
K_A = []
for i in range(N):
	K_A.append(list(map(int,input().split())))

l = []

for i in range(N):
	del K_A[i][0]
	for j in range(len(K_A[i])):
		l.append(K_A[i][j])
		
count = 0

for i in range(K+1):
	print(l.count(i),i)
	if l.count(i) == N:
		count  += 1

print(count)


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

l = []

for i in range(N):
	del K_A[i][0]
	for j in range(len(K_A[i])):
		l.append(K_A[i][j])
		
count = 0

for i in range(K+1):
	if l.count(i) == N:
		count  += 1

print(count)


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())
m = 0
for i in range(M):
    m += 2**i
for n in range(N):
    k = list(map(int, input().split()))
    k_n = k[0]
    _m = 0
    for i in range(k_n):
        _m ^= 2**(k[i+1]-1)
    m &= _m
    print(bin(m))
ret = bin(m).count("1")
print(ret)

N, M = map(int, input().split())
m = 0
for i in range(M):
    m += 2**i
for n in range(N):
    k = list(map(int, input().split()))
    k_n = k[0]
    for i in range(k_n):
        m &= 2**k[i+1]
ret = bin(m).count("1")
print(ret)

N, M = map(int, input().split())
m = 0
for i in range(M):
    m += 2**i
for n in range(N):
    k = list(map(int, input().split()))
    k_n = k[0]
    _m = 0
    for i in range(k_n):
        _m ^= 2**(k[i+1]-1)
    m &= _m
ret = bin(m).count("1")
print(ret)

Verdicts: Wrong Answer

Wrong Answer

Accepted