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

for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
    if N==1:
       print(len(l[0])) 
    print(len(a))


N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
del l[0:N][0]
#print(l)
sum = []
for i in range(N-1):
  sum += list(set(l[i])&set(l[i+1]))

print(len(sum))

N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]
if N!=1:
  for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
    print(len(a))
else:


N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]
if N!=1:
  for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
    print(len(a))
else:
  print(len(l))

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

for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
if N==1:
  print(len(l[0])) 
else:
  print(len(a))

Verdicts: Wrong Answer

Wrong Answer

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())
kx = [list(map(int,input().split())) for i in range(n)]
c1 = 0
c2 = 0

for i in kx[0]:
  for j in range(1,n):
    if i in kx[j]:
      c1 += 1
  if c1 == n-1:
    c2 += 1
  c1 = 0

print(c2)

n,m = map(int,input().split())
kx = [list(map(int,input().split())) for i in range(n)]
c1 = 0
c2 = 0
 
for i in kx[0]:
  for j in range(1,n):
    if i in kx[j]:
      c1 += 1
  if c1 == n-1:
    c2 += 1
  c1 = 0
print(c2)

n,m = map(int,input().split())
kx = [list(map(int,input().split())) for i in range(n)]
c1 = 0
c2 = 0

for i in range(1,len(kx[0])):
  for j in range(1,n):
    if kx[0][i] in kx[j][1:]:
      c1 += 1
  if c1 == n-1:
    c2 += 1
  c1 = 0

print(c2)

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())
K = list(map(int, input().split()))
del K[0]
for i in range(N):
    k = list(map(int, input().split()))
    del k[0]
    K = list(set(k) & set(K))
print(len(K))


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

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):
K = [None]*30
A = [None]*30
Ms = [0]*31
def main():
    N, M = map(int, input().split())
    for i in range(N):
        K[i], *A[i], = map(int, input().split())
    for i in A:
        if i == None:
            break
        for j in i:
            print(j)
            Ms[j] += 1
    print(Ms.count(N))

main()


K = [None]*30
A = [None]*30
Ms = [0]*31
def main():
    N, M = map(int, input().split())
    for i in range(N):
        K[i], *A[i], = map(int, input().split())
    for i in A:
        if i == None:
            break
        for j in i:
            Ms[j] += 1
    print(Ms.count(N))

main()


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())
print(N, M)

def main():
    cnts = [0]*M
    ans = 0

    for i in range(N):
        A = list(map(int, input().split()))[1:]
        for a in A:
            cnts[a-1] += 1

    for cnt in cnts:
        if cnt == N:
            ans += 1
    return ans


if __name__ == '__main__':
    print(main())


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

def main():
    cnts = [0]*M
    ans = 0

    for i in range(N):
        A = list(map(int, input().split()))[1:]
        for a in A:
            cnts[a-1] += 1

    for cnt in cnts:
        if cnt == N:
            ans += 1
    return ans


if __name__ == '__main__':
    print(main())


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):
  a,*b = map(int,input().split())
  S &= set(b)
print(len(S))
  

n,m = map(int,input().split())
S = set(range(1,m+1))
for i in range(n):
  a,*b = map(int,input().split())
  S &= set(b)
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,m = map(int, input().split())
q=[input() for i in range(n)]
l=[i+1 for i in range(m)]
l1=[i+1 for i in range(m)]
for i in q:
  t=list(map(int, i.split()))
  for k in l1:
    if (k not in t[1:]):
      l.remove(k)
print(len(l))


n,m = map(int, input().split())
q=[input() for i in range(n)]
l=[i+1 for i in range(m)]
l1=[i+1 for i in range(m)]
for i in q:
  t=list(map(int, i.split()))
  for k in l1:
    if (k not in t[1:]):
      if k in l:
      	l.remove(k)
print(len(l))


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 numpy as np
n,m = map(int, input().split())
arr = np.zeros(m)
for i in range(n):
    ka = np.array([int(i) for i in input().split()])
    for j in range(ka[0]):
        arr[ka[j+1]-1] = 1
ans = int(arr.sum())
print(ans)

import numpy as np
n,m = map(int, input().split())
arr = np.zeros(m)
for i in range(n):
    ka = np.array([int(i) for i in input().split()])
    for j in range(ka[0]):
        arr[ka[j+1]-1] += 1
ans = (arr == n).sum()
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 collections
n, m = map(int, input().split())
a_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])
col = collections.Counter(a_list)
print(sum([k for k, v in col.items() if v == n]))

import collections
n, m = map(int, input().split())
a_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])
col = collections.Counter(a_list)
print(len([k for k, v in col.items() if v == 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):
5 5
4 2 3 4 5
4 1 3 4 5
4 1 2 4 5
4 1 2 3 5
4 1 2 3 4

def actual(N, M, K, A):
    
    s = set(A[0])

    for a in A[1:]:
        s &= set(a)

    return len(s)


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

K = []
A = []

for _ in range(N):
    ka = list(map(int, input().split()))
    K.append(ka[0])
    A.append(ka[1:])

print(actual(N, M, K, 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())
L=[]
for i in range(N):
  a=list(map(int,input().split()))
  for b in a:
    L.append(b)
ans=0
for i in range(30):
  if L.count(i)==N:
    ans=ans+1
print(ans)

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

n,m = map(int,input().split())
num = [list(map(int,input().split())) for i in range(n)]
l = [0]*m
for i in range(n):
    for j in num[i][1:]:
        l[j-1] += 1
print(l.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())
a=[]
ans=0
for i in range(n):
    for j in map(int,input().split()):
        a.append(j)

for k in range(m):
    if a.count(k) == m:
        ans+=1
print(ans)
    

    

n,m=map(int,input().split())
a=[]
ans=0
for i in range(n):
    ii=0
    for j in map(int,input().split()):
        if ii > 0:
        	a.append(j)
        ii+=1
#print(a)
 
for k in range(1,m+1):
    if a.count(k) == 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())
num = []
for i in range(N):
    num.append(list(map(int,input().split()[1:])))
count = 0
for j in range(1,M+1):
    if all(j in num[i] for i in range(N)):
        count += 1
print(count)   
print(num)

N,M = map(int,input().split())
num = []
for i in range(N):
    num.append(list(map(int,input().split()[1:])))
count = 0
for j in range(1,M+1):
    if all(j in num[i] for i in range(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):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy


def main():
  n, m = list(map(int, input().split()))
  a = numpy.ones(m)

  for _ in range(n):
    b = numpy.zeros(m)
    b[list(map(lambda x: int(x) - 1, input().split()))[1:]] = 1
    a *= b

  print(a)
  print(int(numpy.sum(a)))


if __name__ == '__main__':
  main()



#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy


def main():
  n, m = list(map(int, input().split()))
  a = numpy.ones(m)

  for _ in range(n):
    b = numpy.zeros(m)
    b[list(map(lambda x: int(x) - 1, input().split()))[1:]] = 1
    a *= b

  print(int(numpy.sum(a)), flush=True)


if __name__ == '__main__':
  main()



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

counter = []
ans = 0
for i in range(m):
  counter.apeend(0)

for i in range(n):
  ls = [map(int, input().split())]
  for i in range(1, ls[0]+1):
    num = counter[ls[i] - 1]
    counter.insert(ls[i]-1, num + 1)
for i in range(m):
  if counter[i] == n:
    ans += 1
print(ans)



n,m = map(int, input().split()) 
 
counter = []
ans = 0
for i in range(m):
  counter.append(0)
 
for i in range(n):
  ls = list(map(int, input().split()))
  kazu = ls[0]
  for i in range(1, kazu+1):
    num = counter[ls[i] - 1]
    counter[ls[i]-1] = num + 1
for i in range(m):
  if counter[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())
all = {int(i) for i in range(1, i + 1)}
for _ in range(n):
    k, *i_th = map(int, input().split())
    all &= set(list(i_th))
print(len(all))

n, m = map(int, input().split())
all = {int(i) for i in range(1, m + 1)}
for _ in range(n):
    k, *i_th = map(int, input().split())
    all &= set(i_th)
print(len(all))

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())
x=[]
sum=0
for i in range(n):
  s=list(map(int,input().split()))
  x+=s
for i in range(1,m+1):
  if x.count(i)==n:
    sum+=1
print(sum)

n,m=map(int,input().split())
x=[]
sum=0
for i in range(n):
  s=list(map(int,input().split()))
  s.pop(0)
  x+=s
for j in range(1,m+1):
  if x.count(j)==n:
    sum+=1
print(sum)


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
import itertools

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

counter = collections.Counter(a)

mode_v = counter.most_common()[0][-1]
it = itertools.takewhile(
    lambda kv: kv[-1] == mode_v, counter.most_common()
)
if len(it)>=N:
	print(len(it)>=N)
else:
  	print(0)
 
 
  
 

N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extend(b)
  
c=Counter(a)
    
freq_scores = c.most_common()
    
max_count = freq_scores[0][1]

modes = []
    　
for num in freq_scores:
	if num[1] == max_count:
    	modes.append(num[0])

print(len(a[modes]))


import collections
import itertools

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

counter = collections.Counter(a)

ret = [letter for letter,count in counter.most_common() if count == counter.most_common()[0][1]]
if N == counter.most_common()[0][1]:
	print(len(ret))
else:
  print(0)
 

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

s=[]
for t in e:
  b_list=0
  for x in t[1:]:
    b_list = b_list | pow(2,x-1)
  s.append(b_list)
result=pow(2,30)-1
for i in s:
   result = result & i
cnt=0
for i in range(30):
  if result & pow(2,i):
    cnt+=1


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

s=[]
for t in e:
  b_list=0
  for x in t[1:]:
    b_list = b_list | pow(2,x-1)
  s.append(b_list)
result=pow(2,30)-1
for i in s:
   result = result & i
cnt=0
for i in range(30):
  if result & pow(2,i):
    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())

a = set(str(x) for x in range(1,M+1))
for i in range(N):
  li = list(input().split())
  a = a & set(li[1:])

print (' '.join(a))

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

a = set(str(x) for x in range(1,M+1))
for i in range(N):
  li = list(input().split())
  a = a & set(li[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):
N, M = map(int, input().split())
A0 = list(map(int, input().split()))
A0.pop(0)
for i in range(N-1):
    A = list(map(int, input().split()))
    for j in A0:
        
        if j not in A[1:]:
            A0.remove(j)
            print(A0)

print(len(A0))

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

for i in range(N-1):
    A = list(map(int, input().split()))
    for j in A0[1:]:
        if j not in A[1:]:
            A0.remove(j)
            print(A0)

print(len(A0[1:]))

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

ans = 0
for i in range(M):
    if cnt[i]==N:
        ans += 1
        
print(ans)

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

n,m = map(int,input().split())
ans = [0]*(m+1)
count = 0
for i in range(n):
  l = list(map(int,input().split()))
  for j in range(1,l[0]+1):
    ans[l[j]] += 1
        
for i in ans:
  if i == 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):
s,m=map(int,input().split())
l=[]
for _ in range(s):
  n=[]
  n=list(map(int,input().split()))
  n.pop(0)
  l=l+n
m=dict()
for i in l:
  if i in m:
    m[i]+=1
  else:
    m[i]=1
  print(m)
cnt=0
for j in m:
  if m[j]==s:
    cnt+=1
print(cnt)

s,m=map(int,input().split())
l=[]
for _ in range(s):
  n=[]
  n=list(map(int,input().split()))
  n.pop(0)
  l=l+n
m=dict()
for i in n:
  if i in m:
    m[i]+=1
  else:
    m[i]=1
cnt=0
for j in m:
  if m[j]==s:
    cnt+=1
print(cnt)
  

s,m=map(int,input().split())
l=[]
for _ in range(s):
  n=[]
  n=list(map(int,input().split()))
  n.pop(0)
  l=l+n
m=dict()
for i in l:
  if i in m:
    m[i]+=1
  else:
    m[i]=1
cnt=0
for j in m:
  if m[j]==s:
    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):
def read():
    return int(input())

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

n, m = reads()
a = set(reads()[1:])
for _ in range(n - 1):
  a &= set(input().split()[1:])
print(len(a))

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

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

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 numpy as np

N, M = map(int, input().split())
A = np.full((N, M), 0)
for i in range(N):
    Ka = map(int, input().split())
    a = Ka[1:]
    for j in a:
        A[i, j-1] = 1
        
print(np.sum(np.prod(A, axis=0)))
        

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

like = [1] * M

for i in range(N):
    K, *A = map(int, input().split())
    for i in range(M):
        if i + 1 not in A:
            like[i] = 0
print(sum(like))
    

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 = [list(map(int, input().split())) for row in range(N)]
if N = 1:
	print(K[0][0])
else:
	for i in range(N):
		K[i].pop(K[i][0])

	foods = set(K[0])
	i = 0
	while i < N:
		foods = foods.intersection(set(K[i]))
		if foods == set():
			break
		
		else:
			i += 1
	print(len(list(foods)))





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

K = [list(map(int, input().split())) for row in range(N)]
if N = 1:
	print(K[0][0])
else:
	for i in range(N):
		K[i].pop(K[i][0])

	foods = set(K[0])
	i = 0
	while i < N:
		foods = foods.intersection(set(K[i]))
		if foods == set():
			break
		
		else:
			i += 1
	print(len(list(foods)))





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

K = [list(map(int, input().split())) for row in range(N)]
if N = 1:
	print(K[0][0])
else:
	for i in range(N):
		K[i].pop(K[i][0])

	foods = set(K[0])
	i = 0
	while i < N:
		foods = foods.intersection(set(K[i]))
		if foods == set():
			break
		
		else:
			i += 1
	print(len(list(foods)))





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

K = [list(map(int, input().split())) for row in range(N)]
if N == 1:
	print(K[0][0])
else:
	for i in range(N):
		K[i].remove(K[i][0])

	foods = set(K[0])
	i = 0
	while i < N:
		foods = foods.intersection(set(K[i]))
		if foods == {}:
			
			break
			exit()
		i += 1
	print(len(list(foods)))





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

n,m = map(int,input().split())
ans = [0]*m
i = j = 0
for i in range(n):
  a = list(map(int,input().split()))
  for j in range(1,a[0]+1):
    ans[a[j]-1] += 1
print(ans.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())
data = [input().split() for i in range(N)] 
# print(len(data))
result=[]
for j in range(N):
    result=result+data[j][1:]
# print(result)
result=[int(s) for s in result]
ans=[x for x in result if result.count(x) == N]
print(len(ans))

N,M=map(int,input().split())
data = [input().split() for i in range(N)] 
# print(len(data))
result=[]
for j in range(N):
    result=result+data[j][1:]
# print(result)
ans=[x for x in result if result.count(x) == N]
print(len(ans))

N,M=map(int,input().split())
data = [input().split() for i in range(N)] 
result=[]
for j in range(N):
    result=result+data[j][1:]
result=[int(s) for s in result]
ans=[x for x in result if result.count(x) == N]
print(int(len(ans)/N))


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):
import fractions
from functools import reduce

def gcd(numbers):
    return reduce(fractions.gcd, numbers)

n = int(input())
print(gcd(list(map(int, input().split()))))

import fractions
from functools import reduce

def gcd(numbers):
    return reduce(fractions.gcd, numbers, 1)

n = int(input())
print(gcd(list(map(int, input().split()))))

n, m = map(int, input().split())
temp = list(map(int, input().split()))
temp = set(temp[1:])
for i in range(n-1):
	temp2 = list(map(int, input().split()))
	temp2 = set(temp2[1:])
	temp = temp.intersection(temp2)
print(len(temp))

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())
L = list()
ans = list()
for i in range(N):
  l = [int(_) for _ in input().split()]
  for j in range(len(l[0])):
    ans.append(l[j+1])
  l = L.copy()
cnt = 0
num = 0
s = -1
ans.sort()
for k in ans:
  if s == k:
    cnt += 1
    if cnt == N:
      num += 1
      cnt = 0
  else:
    cnt = 1
    s = k
print(num)
    

N,M=map(int,input().split())
a=[0]*(M+1)
for i in range(N):
  l=list(map(int,input().split()))
  for j in range(l[0]):
    a[l[j+1]]+=1
print(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= (int(i) for i in input().split())
for num in range(N):
    lst[num] = [int(i) for i in input().split()]
    
food = np.zeros((N,M))
for i in range(N):
    for j in range(lst[i][0]):
        #print(lst[i][j+1])
        food[i][lst[i][j+1]-1] = 1
#print(food)
s = np.sum(food, axis=0)
print(len(s[s==N]))

N, M= (int(i) for i in input().split())
lst = [[int(i) for i in input().split()] for i in range(n)] 

import numpy as np
food = np.zeros((N,M))
for i in range(N):
    for j in range(lst[i][0]):
        #print(lst[i][j+1])
        food[i][lst[i][j+1]-1] = 1
#print(food)
s = np.sum(food, axis=0)
print(len(s[s==N]))

N, M= (int(i) for i in input().split())
lst = [[int(i) for i in input().split()] for i in range(n)] 
import numpy as np
food = np.zeros((N,M))
for i in range(N):
    for j in range(lst[i][0]):
        #print(lst[i][j+1])
        food[i][lst[i][j+1]-1] = 1
#print(food)
s = np.sum(food, axis=0)
print(len(s[s==N]))

N, M= (int(i) for i in input().split())
lst = [[int(i) for i in input().split()] for i in range(n)]

N, M= (int(i) for i in input().split())
lst = [[int(i) for i in input().split()] for i in range(N)]
import numpy as np
food = np.zeros((N,M))
for i in range(N):
    for j in range(lst[i][0]):
        #print(lst[i][j+1])
        food[i][lst[i][j+1]-1] = 1
#print(food)
s = np.sum(food, axis=0)
print(len(s[s==N]))

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 = (int(i) for i in input().split())
hoge = set((int(i) for i + 1 in range(M)))
for i in range(N):
    likes[i] = set()
    likes[i].add((int(i) for i in input().split()))
    hoge &= likes[i]

c = len(hoge)

print(hoge)

N, M = (int(i) for i in input().split())
hoge = {i for i + 1 in range(M)}
for i in range(N):
    likes[i] = set()
    likes[i] = {i for i in input().split()}
    hoge &= likes[i]

c = len(hoge)

print(hoge)

N, M = (int(i) for i in input().split())
hoge = {i + 1 for i  in range(M)}
print(hoge)
for i in range(N):
    likes = set()
    on = input().split()
    on.pop(0)
    likes = {int(j) for j in on}
    print(likes)
    hoge &= likes
    print("result")
    print(hoge)

c = len(hoge)

print(c)

N, M = (int(i) for i in input().split())
hoge = {i + 1 for i  in range(M)}

for i in range(N):
    likes = set()
    on = input().split()
    on.pop(0)
    likes = {int(j) for j in on}
    hoge &= likes


c = len(hoge)

print(c)

Verdicts: Runtime Error

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())
ka = [input() for i in range(n)]
common = {i for i in range(1,m+1)}
for k in ka:
    tmp = [int(i) for i in k.split()]
    tmp = set(tmp)
    common = common.intersection(tmp)

print(len(common))

n, m= map(int, input().split())
ka = [input() for i in range(n)]
common = {i for i in range(1,m+1)}
for k in ka:
    tmp = k.split()
    tmp = set(tmp[1:])
    common = common.intersection(tmp)

print(len(common))

n, m= map(int, input().split())
ka = [input() for i in range(n)]
common = {i for i in range(1,m+1)}
for k in ka:
    tmp = {int(i) for i in k.split()[1:]}
    common = common.intersection(tmp)

print(len(common))

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

like_count = [0 for _ in range(m+1)]

for _ in range(N):
    tmp = list(map(int,input().split()))
    like_list = tmp[1:]
    for like in like_list:
        like_count[like] += 1

count = 0
for value in like_count:
    if value == N:
        count += 1

print(count)

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


like_count = [0 for _ in range(M+1)]

for _ in range(N):
    tmp = list(map(int,input().split()))
    like_list = tmp[1:]
    for like in like_list:
        like_count[like] += 1

count = 0
for value in like_count:
    if value == 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):
import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))
b = np.zeros((n, m))
for i in range(n):
    w = k[i]
    for j in range(len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == n))


import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))
b = np.zeros((n, m))
for i in range(n):
    w = a[i]
    for j in range(len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == n))


import numpy as np
n, m = map(int, input().split())
k = [0] * n
for i in range(n):
    k[i] = list(map(int, input().split()))

b = np.zeros((n, m))
for i in range(n):
    w = k[i]
    for j in range(1, len(w)):
        b[i, int(w[j])-1] = 1
print(sum(b.sum(axis=0) == 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())

ans = 0
i_list = []

for i in range(N):
	tmp_list = list(map(int,input().split()))
	i_list.extend(tmp_list[1:])
	print(i_list)

for i in range(1,M+1):
  if i_list.count(i) == N:
    ans += 1

print(ans)

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

ans = 0
i_list = []

for i in range(N):
	tmp_list = list(map(int,input().split()))
	i_list.extend(tmp_list[1:])

for i in range(1,M+1):
  if i_list.count(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())
erase = {}
for i in range(N):
    a = list(map(int, input().split())) #a = [2,1,3] -> a = [3,1,2,3]
    
    if i == 0:
        food = a[1:] #food = [1] -> food = [1,3]
    else:
        for j in range(len(food)): 
            if food[j] not in a[1:]:
                erase.add(food[j])
print(len(food)-len(erase))      


N, M = map(int, input().split())
erase = {}
for i in range(N):
    a = list(map(int, input().split())) #a = [2,1,3] -> a = [3,1,2,3]
    
    if i == 0:
        food = a[1:] #food = [1] -> food = [1,3]
    else:
        for j in range(len(food)): 
            if food[j] not in a[1:]:
                erase.add(j)
print(len(food)-len(erase))      


N, M = map(int, input().split())
erase = {}
for i in range(N):
    a = list(map(int, input().split()))
    
    if i == 0:
        food = a[1:]
    else:
        for j in range(len(food)): 
            if food[j] not in a[1:]:
                erase.add(food[j])
print(len(food)-len(erase))      


N, M = map(int, input().split())
erase = set()
for i in range(N):
    a = list(map(int, input().split())) 
    
    if i == 0:
        food = a[1:]
    for j in range(len(food)): 
        
        if food[j] not in a[1:]:
            erase.add(j)

print(len(food)-len(erase))      

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

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

#ABC118

n,m = list(map(int,input().split()))
food = [0] * m
for i in range(n):
    a = list(map(int,input().split()))
    for j in a[1:]:
        food[j-1] += 1
        
l = [food[i] for i in range(len(food)) if food[i] == n]
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):
x,y = map(int,input().split())
a = []
n=int,input()
for i in range(n):
    b = list(map(int,input().split()))
    a.append(b[1:])
c = [i for i in range (1,m+1)]
for i in a:
    for j in range(m):
        if c[j] not in i:
            c[j]=0
print(m-c.count(0))

x,y = map(int,input().split())
a = list(map(int,input().split()))
b = set(a[1:])
for i in range(x-1):
    a = list(map(int,input().split()))
    b = b & set(a[1:])
print(len(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):
N,M = map(int,input().split())
res = []
for i in range(N):
    res.append(list(map(int,input().split())))

if N == 1:
    print(res[0][0])
    exit()

s = [0 for i in range(M)]
for i in res:
    for j in i[1:]:
        s[j-1] += 1

count = 0
for i in range(N):
    if s[i] == N:
        count += 1

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

if N == 1:
    print(res[0][0])
    exit()

s = [0 for i in range(M)]
for i in res:
    for j in i[1:]:
        #print(j)
        s[j-1] += 1

#print(s)

count = 0
for i in range(M):
    if s[i] == 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):
n,m=[int(i) for i in input().split()]
P=[[int(i) for i in input().split()] for j in range(n)]

for i in range(n):
    del P[i][0]
    
K = set(P[0])
L = {}
for i in range(1,n):
    L = set(P[i])
    K = K & L
M = list(K)
if len(M) == 0:
    print(0)
else:
    for i in range(len(M)):
        print(M[i])

n,m=[int(i) for i in input().split()]
P=[[int(i) for i in input().split()] for j in range(n)]

for i in range(n):
    del P[i][0]
    
K = set(P[0])
L = {}
for i in range(1,n):
    L = set(P[i])
    K = K & L
print(len(K))

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 = [0]*N
A = [[0]*M for i in range(N)]
for i in range(N):
  x = list(map(int, input().split()))
  K[i] = x[0]
  A[i] = x[1:]
l = A[0]
for i in range(1, N):
  j = 0
  max_j = len(l)-1
  j = 0
  while(j != max_j+1):
    print(l, A[i])
    if l[j] not in A[i]:
      del l[j]
      max_j -= 1
      j -= 1
    j += 1
print(len(l))

N, M = map(int, input().split())
K = [0]*N
A = [[0]*M for i in range(N)]
for i in range(N):
  x = list(map(int, input().split()))
  K[i] = x[0]
  A[i] = x[1:]
l = set(A[0])
for i in range(1, N):
  l &= set(A[i])
print(len(l))

Verdicts: Wrong Answer

Accepted