problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p03126 | u109632368 | 2,000 | 1,048,576 | 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. | ['n,m = map(int, input().split())\n\nlistA = [[list(map(int, input().split()))] for j in range(n)]\n\nans = 0\n\n\nfor a in range(m):\n for i in range(n):\n if a in listA[i]:\n ans += 1\n\n\nprint(ans)', 'n,m = map(int, input().split())\n\nlistA = [[list(map(int, input().split()))] for j in range(n)]\n\nans = 0\n\n\nfor a in range(m):\n for i in range(n):\n listA[i].pop(0)\n if a in listA[i]:\n ans += 1\n\n\nprint(ans)', 'n,m = map(int, input().split())\n\nlistA = [list(map(int, input().split())) for j in range(n)]\n\nans = 0\n\n\nfor a in range(1, m+1):\n ok = True\n for i in range(n):\n if a not in listA[i][1:]:\n ok = False\n if ok:\n ans += 1\n\n\n\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s246705875', 's770658529', 's590635489'] | [3060.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0] | [207, 231, 263] |
p03126 | u116233709 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\nans=[0]*m\nfor i in range(n):\n x=[int(a),for a in input().split()]\n for j in range(1,x[0]+1):\n ans[x[j]-1]+=1\n \nprint(ans.count(n)) \n \n', 'n,m=map(int,input().split())\nans=[0]*m\nfor i in range(n):\n x=[int,input().split()]\n for j in range(1,x[0]+1):\n ans[x[j]-1]+=1\n \nprint(ans.count(n)) \n ', 'n,m=map(int,input().split())\nans=[0]*m\nfor i in range(n):\n x=list(map(int,input().split()))\n for j in range(1,x[0]+1):\n ans[x[j]-1]+=1\n \nprint(ans.count(n)) \n \n\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s721395120', 's747375433', 's176863282'] | [2940.0, 2940.0, 2940.0] | [18.0, 18.0, 17.0] | [172, 159, 170] |
p03126 | u122195031 | 2,000 | 1,048,576 | 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. | ['N,M = list(map(int,input().split()))\nlst = list(map(int,input().split()))\nfor i in range(N-1):\n k = list(map(int,input().split()))\n for j in k[1:]:\n if j in lst:\n continue\n else:\n lst.remove(j)\nprint(len(lst))', 'N,M = [int(x) for x in input().split()]\nk = [0] * (M+1)\nfor i in range(N):\n a = [int(x) for i in input().split()]\n del a[0]\n for j in a:\n k[j] += 1\nprint(k.count(N))', 'n,m = map(int, input().split())\nans = list(input().split())\nans = set(ans[1:])\nfor i in range(n-1):\n b = list(input().split())\n b = set(b[1:])\n ans = ans & b\nprint(len(ans))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s078733207', 's512113924', 's163719205'] | [3060.0, 3060.0, 3060.0] | [18.0, 18.0, 17.0] | [251, 181, 182] |
p03126 | u123745130 | 2,000 | 1,048,576 | 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. | ['import collections as co\nn,m=map(int,input().split())\nl=[]\nfor i in range(n):\n j,*k=map(int,input().split())\n l.extend(k)\nfor p,q in co.Counter(l).items():\n if q==n:print(p)', 'import collections as co\nn,m=map(int,input().split())\nl=[]\nfor i in range(n):\n j,*k=map(int,input().split())\n l.extend(k)\ncount_num=0\nfor p,q in co.Counter(l).items():\n if q==n:count_num+=1\nprint(count_num)'] | ['Wrong Answer', 'Accepted'] | ['s755836338', 's397683456'] | [3316.0, 3316.0] | [21.0, 21.0] | [182, 215] |
p03126 | u124428040 | 2,000 | 1,048,576 | 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. | ['import sys\n\n(sn, sm) = sys.stdin.readline().split()\nn = int(sn)\nm = int(sm)\n\nflg = [0 for j in range(m)]\nfor i in range(n):\n sa = sys.stdin.readline().split()\n for saj in sa:\n aj = int(saj)\n flg[aj - 1] += 1\n\nsuma = 0\nfor sumaj in flg:\n if sumaj == n:\n suma += 1\nprint(suma)', 'import sys\n\n(sn, sm) = sys.stdin.readline().split()\nn = int(sn)\nm = int(sm)\n\nflg = [0 for j in range(m)]\nfor i in range(n):\n sa = sys.stdin.readline().split()\n for saj in sa[1:]\n aj = int(saj)\n flg[aj - 1] += 1\n\nsuma = 0\nfor sumaj in flg:\n if sumaj == n:\n suma += 1\nprint(suma)', 'import sys\n\n(sn, sm) = sys.stdin.readline().split()\nn = int(sn)\nm = int(sm)\n\nflg = [0 for j in range(m)]\nfor i in range(n):\n sa = sys.stdin.readline().split()\n if len(sa) > 1:\n\t for saj in sa[1:]:\n \taj = int(saj)\n \tflg[aj - 1] += 1\n\nsuma = 0\nfor sumaj in flg:\n if sumaj == n:\n suma += 1\nprint(suma)', 'import sys\n\n(sn, sm) = sys.stdin.readline().split()\nn = int(sn)\nm = int(sm)\n\nflg = [0 for j in range(m)]\nfor i in range(n):\n sa = sys.stdin.readline().split()\n if len(sa) > 1:\n\t for saj in sa[1:]\n \taj = int(saj)\n \tflg[aj - 1] += 1\n\nsuma = 0\nfor sumaj in flg:\n if sumaj == n:\n suma += 1\nprint(suma)', 'import sys\n\n(sn, sm) = sys.stdin.readline().split()\nn = int(sn)\nm = int(sm)\n\nflg = [0 for j in range(m)]\nfor i in range(n):\n sa = sys.stdin.readline().split()\n for saj in sa:\n aj = int(saj)\n flg[aj - 1] += 1\n\nsuma = 0\nfor sumaj in range(flg):\n if sumaj == n:\n suma += 1\nprint(suma)', 'import sys\n\n(sn, sm) = sys.stdin.readline().split()\nn = int(sn)\nm = int(sm)\n\nflg = [0 for j in range(m)]\nfor i in range(n):\n sa = sys.stdin.readline().split()\n if len(sa) > 1:\n for saj in sa[1:]:\n aj = int(saj)\n flg[aj - 1] += 1\n\nsuma = 0\nfor sumaj in flg:\n if sumaj == n:\n suma += 1\nprint(suma)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s170578159', 's317612203', 's542662816', 's559507251', 's710638151', 's833601274'] | [3064.0, 2940.0, 2940.0, 2940.0, 3064.0, 3064.0] | [19.0, 18.0, 17.0, 17.0, 18.0, 18.0] | [286, 289, 311, 310, 293, 314] |
p03126 | u127499732 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\ns0 = set(input().split())\nfor _ in range(n-1):\n s = set(input(split()))\n s0 &= s\nprint(len(s0))', 'n,m=map(int,input().split())\nk,*s0=map(int,input().split())\ns0 = set(s0)\nfor _ in range(n-1):\n k,*s = map(int,input().split())\n s = set(s)\n s0 &= s\nprint(len(s0))'] | ['Runtime Error', 'Accepted'] | ['s840212226', 's862562115'] | [3060.0, 3060.0] | [17.0, 19.0] | [126, 165] |
p03126 | u129978636 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\nlovelist=[]\ncount=0\nfor _ in range(n):\n a=list(map(int,input().split()))\n a=set(a[1:])\n lovelist.append(a)\nfor i in range(n-1):\n lovelist[i+1]=lovelist[i]&lovelist[i+1]\n print(len(lovelist[-1]))', 'n,m=map(int,input().split())\nlovelist=[]\nfor _ in range(n):\n a=set(sorted(list(map(int,input().split()))))\n lovelist.append(a)\nfor i in range(n-1):\n lovelist[i+1]=lovelist[i]&lovelist[i+1]\nprint(len(lovelist[2]))', 'n,m=map(int,input().split())\nl=[]\nfor _ in range(n):\n a=list(map(int,input().split()))\n a=set(a[1:])\n l.append(a)\nfor i in range(n-1):\n l[i+1]=l[i]&l[i+1]\nprint(len(l[-1]))\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s593402497', 's603124864', 's909789515'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 18.0] | [238, 221, 185] |
p03126 | u140410083 | 2,000 | 1,048,576 | 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. | ['N,M = map(int,input().split())\nA = [[0]*M]*N\nfor i in range(N):\n A[i] = list(map(int,input().split()))\n del A[i][0]\n\nI = [True]*(M)\n\nfor j in range(1,M):\n for ki in range(N):\n if not (j in A[ki]):\n I[j-1] = False\n\nprint(I.count(True))', 'N,M = map(int,input().split())\nA = [[0]*M]*N\nfor i in range(N):\n A[i] = list(map(int,input().split()))\n del A[i][0]\n\nI = [True]*(M)\n\nfor j in range(1,M+1):\n for ki in range(N):\n if not (j in A[ki]):\n I[j-1] = False\n\nprint(I.count(True))'] | ['Wrong Answer', 'Accepted'] | ['s851679686', 's217744893'] | [3064.0, 3060.0] | [17.0, 18.0] | [261, 263] |
p03126 | u141574039 | 2,000 | 1,048,576 | 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. | ['N,M=map(int,input().split())\nA=[0]*(M+1)\ncnt=0\nfor i in range(N):\n S=list(map(int,input().split()))\n for j in range(1,S[0]+1):\n A[S[j]]+=1\n #print(A)\nprint(A)\nfor i in range(len(A)):\n if A[i]>=N:\n cnt+=1\nprint(cnt)', 'N,M=map(int,input().split())\nA=[0]*(M+1)\ncnt=0\nfor i in range(N):\n S=list(map(int,input().split()))\n for j in range(1,S[0]+1):\n A[S[j]]+=1\n #print(A)\n#print(A)\nfor i in range(len(A)):\n if A[i]>=N:\n cnt+=1\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s009101793', 's319259253'] | [3064.0, 3060.0] | [18.0, 17.0] | [226, 227] |
p03126 | u149284596 | 2,000 | 1,048,576 | 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. | ['a = [list(map(int,input().split())) for i in range(n)]\nb = set()\nfor i in range(n):\n a[i].pop(0)\nb = set(a[0])\nfor i in range(n):\n c = set(a[i])\n b = b&c\nprint(len(list(b)))', 'n,m = map(int ,input().split())\na = [list(map(int,input().split())) for i in range(n)]\nb = set()\nfor i in range(n):\n a[i].pop(0)\nb = set(a[0])\nfor i in range(n):\n c = set(a[i])\n b = b&c\nprint(len(list(b)))'] | ['Runtime Error', 'Accepted'] | ['s873941935', 's687522445'] | [3060.0, 3064.0] | [17.0, 17.0] | [182, 214] |
p03126 | u153094838 | 2,000 | 1,048,576 | 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. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Feb 16 20:59:16 2019\n\n@author: doppe\n"""\n\nN, M = map(int, input().split())\nlikeList = []\n\nfor i in range(0, N):\n L = [int(i) for i in input().split()]\n likeListTmp = []\n if (i == 0):\n likeList = L\n else:\n for j in range(1, L[0] + 1):\n if (L[j] in likeList):\n likeListTmp.append(L[j])\n likeList = likeListTmp\n\nprint(len(likeList))', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Feb 16 20:59:16 2019\n\n@author: doppe\n"""\n\nN, M = map(int, input().split())\nlikeList = []\n\nfor i in range(0, N):\n L = [int(i) for i in input().split()]\n likeListTmp = []\n if (i == 0):\n likeList = L\n else:\n for j in range(1, L[0] + 1):\n if (L[j] in likeList):\n likeListTmp.append(L[j])\n likeList = likeListTmp\n\nprint(likeList)', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Feb 16 20:59:16 2019\n\n@author: doppe\n"""\n\nN, M = map(int, input().split())\nlikeList = []\n\nfor i in range(0, N):\n L = [int(i) for i in input().split()]\n likeListTmp = []\n if (i == 0):\n likeList = L[1 : L[0] + 1]\n else:\n for j in range(1, L[0] + 1):\n if (L[j] in likeList):\n likeListTmp.append(L[j])\n likeList = likeListTmp\n\nprint(len(likeList))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s268063321', 's891251423', 's331432080'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 18.0] | [431, 426, 445] |
p03126 | u154143730 | 2,000 | 1,048,576 | 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. | ['N,M = map(int, input().split())\na = list(map(int, input().split()))\nK_past = a[0]\nA_past = a[1:]\n \n\nfor n in range(1,N):\n a = list(map(int, input().split()))\n K = a[0]\n A = a[1:]\n \n for i in range(K):\n l = []\n if A[i] in A_past:\n l.append(A[i])\n A_past = l\n ', 'N,M = map(int, input().split())\na = list(map(int, input().split()))\nK_past = a[0]\nA_past = a[1:]\n \n\nfor n in range(1,N):\n a = list(map(int, input().split()))\n l = []\n K = a[0]\n A = a[1:]\n \n for i in range(K):\n if A[i] in A_past:\n l.append(A[i])\n A_past = l\n \nprint(len(A_past))'] | ['Wrong Answer', 'Accepted'] | ['s677815796', 's642804049'] | [3060.0, 3064.0] | [18.0, 18.0] | [281, 296] |
p03126 | u159994501 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\na,c=[],[]\nfor i in range(m):\n c.append(i+1)\ni=0\nwhile i<n:\n k,a=input().split()\n for j in range(len(c)):\n if c[j] not in a:\n c.remove(c[j])\n j-=1\n j +=1\n a=[]\nprint(len(c))', 'N, M = map(int, input().split())\nq = [0 for _ in range(M)]\nfor i in range(N):\n KA = list(map(int, input().split()))\n for j in range(1, KA[0] + 1):\n q[KA[j] - 1] += 1\nprint(q.count(N))\n'] | ['Runtime Error', 'Accepted'] | ['s422708530', 's892782906'] | [3060.0, 3060.0] | [17.0, 17.0] | [237, 197] |
p03126 | u163320134 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\ncount=[0]*m\nans=0\nlist=[]\nfor i in range(n):\n list.append(list(map(int,input().split())))\n for j in range(1,list[i][0]+1):\n count[j]+=1\nfor i in range(m):\n if count[i]==n:\n ans+=1\nprint(ans)', 'n,m=map(int,input().split())\ncount=[0]*m\nans=0\nlist=[]\nfor i in range(n):\n list.append(list(map(int,input().split())))\n for j in range(1,list[i][0]+1):\n count[list[i][j]-1]+=1\nfor i in range(m):\n if count[i]==n:\n ans+=1\nprint(ans)', 'n,m=map(int,input().split())\ncount=[0]*m\nans=0\nlist=[]\nfor i in range(n):\n list.append(list(map(int,input().split())))\n for j in range(1,list[i][0]+1):\n count[list[i][j]]+=1\nfor i in range(m):\n if count[i]==n:\n ans+=1\nprint(ans)', 'n,m=map(int,input().split())\ncount=[0]*m\nans=0\nlist=[]\nfor i in range(n):\n list.append(list(map(int,input().split())))\n for j in range(1,list[1][0]+1):\n count[j]+=1\nfor i in range(m):\n if count[i]==n:\n ans+=1\nprint(ans)\n', 'n,m=map(int,input().split())\ncount=[0]*m\nans=0\narr=[]\nfor i in range(n):\n arr.append(list(map(int,input().split())))\n for j in range(1,arr[i][0]+1):\n count[arr[i][j]-1]+=1\nfor i in range(m):\n if count[i]==n:\n ans+=1\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s424668512', 's441083195', 's502228064', 's872664212', 's162671823'] | [3064.0, 3064.0, 3064.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 18.0, 18.0] | [228, 239, 237, 229, 235] |
p03126 | u163449343 | 2,000 | 1,048,576 | 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. | ['n,m = map(int, input().split())\nif n == 1:\n print(input().split()[0])\nelse:\n for _ in range(n):\n for i in map(int, set(input().split()[1:])):\n kdict[i] += 1\n print(len([i for i in kdict.values() if i == n]))\n', 'n,m = map(int, input().split())\nif n == 1:\n print(input().split()[0])\nelse:\n kdict = {}\n for _ in range(n):\n for i in map(int, set(input().split()[1:])):\n kdict[i] += 1\n print(len([i for i in kdict.values() if i == n]))\n', 'n,m = map(int, input().split())\nif n == 1:\n print(input().split()[0])\nelse:\n kdict = {i:0 for i in range(1,m+1)}\n for _ in range(n):\n for i in map(int, set(input().split()[1:])):\n kdict[i] += 1\n print(sum([i for i in kdict.items() if i == n]))\n', 'n,m = map(int, input().split())\nif n == 1:\n print(input().split()[0])\nelse:\n kdict = {i:0 for i in range(1,m+1)}\n for _ in range(n):\n for i in map(int, input().split()[1:]):\n kdict[i] += 1\n print(sum([i for i in kdict.items() if i == n]))\n', 'n,m = map(int, input().split())\nif n == 1:\n print(input().split()[0])\nelse:\n kdict = {i:0 for i in range(1,m+1)}\n for _ in range(n):\n for i in map(int, set(input().split()[1:])):\n kdict[i] += 1\n print(len([i for i in kdict.values()() if i == n]))\n', 'n,m = map(int, input().split())\nif n == 1:\n print(input().split()[0])\nelse:\n kdict = {i:0 for i in range(1,m+1)}\n for _ in range(n):\n for i in map(int, set(input().split()[1:])):\n kdict[i] += 1\n print(len([i for i in kdict.values() if i == n]))\n'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s130605390', 's178091355', 's510334268', 's818590676', 's834430501', 's779871866'] | [2940.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 17.0, 18.0, 18.0] | [235, 250, 274, 269, 277, 275] |
p03126 | u163874353 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nl = [list(map(int, input().split())) for i in range(N)]\nm = []\nfor i in range(1, l[0][0] + 1):\n m.append(l[0][i])\nfor i in range(1, N):\n for j in m:\n \n if l[i][1:i[0] + 1].count(j) == 0:\n m.remove(j)\n \nprint(len(m))', 'n, m = map(int,input().split())\n\nm = [0] * 30\nfor i in range(n):\n a = list(map(int, input().split()))\n for j in range(1, len(a)):\n m[a[j] - 1] += 1\n\nprint(m.count(n))\n'] | ['Runtime Error', 'Accepted'] | ['s874491397', 's141517297'] | [3064.0, 3064.0] | [18.0, 19.0] | [290, 180] |
p03126 | u167988719 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\nc = [0] * m\nfor i in range(n):\n k, *a = map(int, input().split())\n print(a)\n for e in a:\n c[e-1] += 1\n\nans = 0\nfor i in range(m):\n if c[i] == n:\n ans += 1\n\nprint(ans)', 'n, m = map(int, input().split())\nc = [0] * m\nfor i in range(n):\n k, *a = map(int, input().split())\n # print(a)\n for e in a:\n c[e-1] += 1\n\nans = 0\nfor i in range(m):\n if c[i] == n:\n ans += 1\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s207710606', 's872667169'] | [3060.0, 3060.0] | [18.0, 17.0] | [225, 227] |
p03126 | u169138653 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\nk=[]\na=[]\nfor i in range(n):\n b=list(map(int,input().split()))\n k.append(b[0])\n a.append(b[1:])\nd={}\nfor i in range(n):\n for j in range(k[i]):\n if a[i][j] not in d:\n d[a[i][j]]=1\n else:\n d[a[i][j]]+=1\nnd=list(d.values())\ncnt=0\nfor i in range(len(nd)):\n if nd[i]==n:\n cnt+=1\nprint(cnt', 'n,m=map(int,input().split())\nk=[]\na=[]\nfor i in range(n):\n b=list(map(int,input().split()))\n k.append(b[0])\n a.append(b[1:])\nd={}\nfor i in range(n):\n for j in range(k[i]):\n if a[i][j] not in d:\n d[a[i][j]]=1\n else:\n d[a[i][j]]+=1\nnd=list(d.values())\ncnt=0\nfor i in range(len(nd)):\n if nd[i]==n:\n cnt+=1\nprint(cnt)\n'] | ['Runtime Error', 'Accepted'] | ['s507345473', 's603124799'] | [3064.0, 3064.0] | [18.0, 18.0] | [336, 338] |
p03126 | u173374079 | 2,000 | 1,048,576 | 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. | ['#!/usr/bin/python\n# coding: UTF-8\nn,m = map(int,input().split())\n\nres = [0 for _ in range(m)]\n\nfor i in range(n):\n for j in list(map(int,input().split()))[1:]:\n res[j-1] += 1\n\nprint(sum([res[i]==m for i in range(m)]))', '#!/usr/bin/python\n# coding: UTF-8\nn,m = map(int,input().split())\n\nres = [0 for _ in range(m)]\n\nfor i in range(n):\n res_tmp = [0 for _ in range(m)]\n for j in list(map(int,input().split()))[1:]:\n res[j-1] += 1\n print(res)\n\nprint(sum([res[i]==n for i in range(m)]))', '#!/usr/bin/python\n# coding: UTF-8\nn,m = map(int,input().split())\n\nres = [1 for _ in range(m)]\n\nfor i in range(n):\n for j in list(map(int,input().split()))[1:]:\n res[j-1] = 0\n\nprint(m-sum(res))\n', '#!/usr/bin/python\n# coding: UTF-8\nimport numpy as np\n\nn,m = map(int,input().split())\n\nres = np.array([1 for _ in range(m)])\nprint(res)\n\nres_init = np.array([-1 for _ in range(m)])\nprint(res_init)\n\nfor i in range(n):\n res_tmp = res_init\n for j in list(map(int,input().split()))[1:]:\n res_init[j-1] = 0\n res += res_tmp\n print(res)\n\nprint(sum(res))', '#!/usr/bin/python\n# coding: UTF-8\nn,m = map(int,input().split())\n\nres = [0 for _ in range(m)]\n\nfor i in range(n):\n for j in list(map(int,input().split()))[1:]:\n res[j-1] += 1\n\nprint(sum([res[i]==n for i in range(m)]))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s117406137', 's201660603', 's342700627', 's738684032', 's108463176'] | [3060.0, 3060.0, 2940.0, 18372.0, 3060.0] | [17.0, 18.0, 18.0, 281.0, 18.0] | [221, 268, 197, 352, 221] |
p03126 | u175590965 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input().split())\nA = list[map(int,input().split()) for i in range(n)]\nans = {i+1 for i in range(m)}\nfor a in A:\n ans = ans & set(a[1:])\nprint(len(ans))', 'n,m = map(int,input().split())\na = list[map(int,input().split()) for i in range(n)]\nans = {i+1 for i in range(m)}\nfor b in a:\n ans = ans & set(a[1:])\nprint(len(ans))', 'n,m = map(int,input().split())\nA = [list(map(int,input().split())for i in range(n)]\nans = {i+1 for i in range(m)}\nfor a in A:\n ans = ans & set(a[1:])\nprint(len(ans))', 'n,m = map(int,input().split())\nA = [list(map(int,input().split()))for i in range(n)]\nans = {i+1 for i in range(m)}\nfor a in A:\n ans = ans & set(a[1:])\nprint(len(ans))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s134938824', 's318385206', 's625560238', 's580142719'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 18.0, 17.0, 18.0] | [168, 168, 168, 169] |
p03126 | u181195295 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input().split())\n\nfood =[0]*(m+1)\n\nfor i in range(n):\n num = list(map(int,input().split()))\n for j in range(1,num[0]):\n food[num[j]] += 1\n\nprint(food.count(n))', 'n,m = map(int,input().split())\n\nfood =[0]*(m+1)\n\nfor i in range(n):\n num = list(map(int,input().split()))\n for j in range(1,num[0]+1):\n food[num[j]] += 1\n\nprint(food.count(n))'] | ['Wrong Answer', 'Accepted'] | ['s322798230', 's293015011'] | [3060.0, 3060.0] | [17.0, 21.0] | [178, 180] |
p03126 | u182004566 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nresult = [0] * N\n\nfor i in range(N):\n K, A = list(map(int, input().split()))\n K = s[0]\n A = s[1:]\n for j in range(K):\n result[A[j]-1] = result[A[j]-1] + 1\n\nprint(result.count(N))\n', 'N, M = map(int, input().split())\nresult = [0] * M\n\nfor i in range(N):\n s = list(map(int, input().split()))\n K = s[0]\n A = s[1:]\n for j in range(K):\n result[A[j]-1] = result[A[j]-1] + 1\n\nprint(result.count(N))\n'] | ['Runtime Error', 'Accepted'] | ['s357999468', 's179076819'] | [3060.0, 3060.0] | [18.0, 17.0] | [231, 228] |
p03126 | u182047166 | 2,000 | 1,048,576 | 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. | ['import sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n# N = int(input())\n# A = [int(x) for x in input().split()]\n# a, b, c = map(int, input().split())\n# name1 = str(input())\n# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}\n\n\n\nn, m = map(int, input().split())\ncon = []\nfor i in range(n):\n k = [int(x) for x in input().split()]\n for j in range(1, k[0]+1):\n con.append(k[j])\nans = 0\nprint(con)\nfor i in range(m):\n if con.count(i+1) == n:\n ans += 1\nprint(ans)\n', 'import sys\n\n\ndef input():\n return sys.stdin.readline()[:-1]\n\n# N = int(input())\n# A = [int(x) for x in input().split()]\n# a, b, c = map(int, input().split())\n# name1 = str(input())\n# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}\n\n\n\nn, m = map(int, input().split())\ncon = []\nfor i in range(n):\n k = [int(x) for x in input().split()]\n for j in range(1, k[0]+1):\n con.append(k[j])\nans = 0\nfor i in range(m):\n if con.count(i+1) == n:\n ans += 1\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s640567062', 's927094522'] | [3060.0, 3060.0] | [18.0, 18.0] | [538, 527] |
p03126 | u192588826 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input().split())\nfoodlike = [0]*m\nfor i in range(n):\n data = list(map(int,input().split()))\n for j in range(data[0]):\n foodlike[data[j-1] - 1] += 1\nprint(foodlike.count(n))\n', 'n,m = map(int,input().split())\nfoodlike = [0]*m\nfor i in range(n):\n data = list(map(int,input().split()))\n for j in range(data[0]):\n foodlike[data[j-1]] += 1\nprint(foodlike.count(n))', 'n,m = map(int,input().split())\nfoodlike = [0]*m\nfor i in range(n):\n data = list(map(int,input().split()))\n for j in range(data[0]):\n foodlike[data[j+1] - 1] += 1\nprint(foodlike.count(n))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s264228631', 's686912393', 's099373109'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 20.0] | [200, 195, 199] |
p03126 | u194894739 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nlike_set = {}\nfor i in range(1,M+1):\n like_set = like_set | {i}\nfor i in range(N):\n k_a = input().split()\n a = k_a[1:]\n like_set = set(a) & like_set\nprint(len(like_set))\n', 'N, M = map(int, input().split())\nlike_set = {}\nfor i in range(1, M+1):\n like_set.add(i)\nfor i in range(N):\n like = input().split()\n like = set(like[1:])\n like_set = like_set & like\nprint(len(like_set))\n', 'N, M = map(int, input().split())\nlike_set = {0}\nfor i in range(1, M+1):\n like_set.add(i)\nfor i in range(N):\n like = list(map(int,input().split()))\n like = set(like[1:])\n like_set = like_set & like\nprint(len(like_set))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s021867769', 's058643652', 's904034166'] | [2940.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [215, 214, 230] |
p03126 | u201856486 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\nres = [[False for _ in range(m)] for _ in range(n)]\n\nfor i in range(n):\n o = list(map(int, input().split()))\n for j, x in enumerate(o):\n if j != 0:\n res[i][x - 1] = True\n\nans = 0\nres = list(zip(*res))\n\nfor i, x in enumerate(res):\n print(x)\n if all(x):\n ans += 1\n\nprint(ans)\n', 'n,m=map(int,input().split());a=[0]*m\nfor _ in a:\n _,*o=map(int,input().split())\n for x in o:res[x-1]+=1\nprint(a.count(n))', 'n,m=map(int,input().split());res=[0]*m\nfor _ in [0]*n:\n _,*o=map(int,input().split())\n for x in o:\n res[x-1]+=1\nans=res.count(n)\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s248404507', 's416647624', 's925077427'] | [3064.0, 2940.0, 3060.0] | [18.0, 18.0, 19.0] | [344, 123, 144] |
p03126 | u207799478 | 2,000 | 1,048,576 | 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. | ['import math\nimport string\n\n\ndef readints():\n return list(map(int, input().split()))\n\n\ndef nCr(n, r):\n return math.factorial(n)//math.factorial(n-r)*math.factorial(r)\n\n\nn, m = map(int, input().split())\ns = set(range(1, m+1))\n# print(s)\nfor i in range(n):\n a = list(map(int, input().split()))\n a_set = set(a[1:])\n # print(a_set)\n s &= a_set\n # print(s)\n print(len(s))\n', 'import math\nimport string\n\n\ndef readints():\n return list(map(int, input().split()))\n\n\ndef nCr(n, r):\n return math.factorial(n)//math.factorial(n-r)*math.factorial(r)\n\n\nn, m = map(int, input().split())\ns = set(range(1, m+1))\n# print(s)\nfor i in range(n):\n a = list(map(int, input().split()))\n a_set = set(a[1:])\n # print(a_set)\n s &= a_set\n # print(s)\nprint(len(s))\n'] | ['Wrong Answer', 'Accepted'] | ['s132505406', 's321838796'] | [3824.0, 3828.0] | [25.0, 25.0] | [390, 386] |
p03126 | u215065194 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\n\ndic = {}\nfor i in range(0,n):\n k = list(map(int,input().split()))\n for j in range(1,len(k)):\n if k[j] in dic:\n dic[k[j]] += 1\n else:\n dic[k[j]] = 1\n \nres = 0\nfor key,value in dic.items():\n if value == n:\n res+=1\nres', 'n,m=map(int,input().split())\n\ndic = {}\nfor i in range(0,n):\n k = list(map(int,input().split()))\n for j in range(1,len(k)):\n if k[j] in dic:\n dic[k[j]] += 1\n else:\n dic[k[j]] = 1\n \nres = 0\nfor key,value in dic.items():\n if value == n:\n res+=1\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s311971576', 's489000105'] | [3060.0, 3064.0] | [18.0, 18.0] | [304, 311] |
p03126 | u216631280 | 2,000 | 1,048,576 | 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. | ['from operator import add\n\nn, m = map(int, input().split())\nli = []\nfor i in range(n):\n li.append(list(map(int, input().split())))\n del li[i][0]\nli = sum(li, [])\n\ncount = 0\nfor num in li:\n if n == li.count(num):\n count += 1\nprint(count)', 'from operator import add\n\nn, m = map(int, input().split())\nli = []\nfor i in range(n):\n li.append(list(map(int, input().split())))\n del li[i][0]\nli = sum(li, [])\nli_2 = list(set(li))\ncount = 0\nfor num in li_2:\n if n == li.count(num):\n count += 1\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s168105939', 's242627039'] | [3060.0, 3064.0] | [29.0, 19.0] | [251, 273] |
p03126 | u220870679 | 2,000 | 1,048,576 | 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. | ['print(6)', 'print(7)', 'import random\nprint(random.randint(1,30))', 'print(30)', 'print(3)', 'print(5)', 'print(0)', 'print(4)', 'print(10)', 'import random\nprint(random.randint(0,30))', 'print(8)', 'print(2)', 'n, m = map(int, input().split())\nk = list(map(int, input().split()))\ndel k[0]\nans = set(k)\n\nfor i in range(n-1):\n x = list(map(int, input().split()))\n del x[0]\n\n x = set(x)\n ans = ans & x\n\nans = list(ans)\n\nprint(len(ans))'] | ['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'] | ['s079749550', 's310276458', 's395383833', 's467301625', 's667017649', 's679446841', 's687867762', 's782820275', 's829859477', 's874515822', 's890294201', 's972438423', 's378618402'] | [2940.0, 2940.0, 4208.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 4592.0, 2940.0, 2940.0, 3064.0] | [17.0, 17.0, 44.0, 17.0, 18.0, 18.0, 17.0, 17.0, 17.0, 50.0, 17.0, 18.0, 17.0] | [8, 8, 41, 9, 8, 8, 8, 8, 9, 41, 8, 8, 233] |
p03126 | u223904637 | 2,000 | 1,048,576 | 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. | ['import numpy as np\nn,m = map(int,input().split())\na=np.zeros(m,dtype=int64)\nfor i in range(n):\n li = list(map(int,input().split()))\n for j in range(li[0]):\n a[li[j+1]-1]=a[li[j+1]-1]+1\nans=0\nfor i in range(m):\n if a[i]==n:\n ans=ans+1\nprint(ans)', 'import numpy as np\nn,m = map(int,input().split())\na=np.zeros(m,dtype=np.int64)\nfor i in range(n):\n li=[]\n li = list(map(int,input().split()))\n \n for j in range(li[0]):\n a[li[j+1]-1]=a[li[j+1]-1]+1\n \nans=0\nfor i in range(m):\n if a[i]==n:\n ans=ans+1\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s762473446', 's961491424'] | [12488.0, 21132.0] | [148.0, 273.0] | [267, 294] |
p03126 | u231936499 | 2,000 | 1,048,576 | 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. | ['N, M = list(map(int, input().split())) \nanswer=[]\na = []\nfood_list=[]\nfor i in range(N):\n answer=list(map(int, input().split()))\n if i==0:\n food_list=answer\n else:\n like_food=[]\n for food in answer[1:-1]:\n if (food in like_food)==False:\n if (food in food_list)==True:\n like_food.append(food)\n food_list=like_food\nprint(len(food_list))', 'N, M = list(map(int, input().split())) \nanswer=[]\na = []\nfood_list=[]\nfor i in range(N):\n answer=list(map(int, input().split()))\n if i==0:\n food_list=answer[1:]\n else:\n like_food=[]\n for food in answer[1:]:\n if (food in like_food)==False:\n if (food in food_list)==True:\n like_food.append(food)\n food_list=like_food\nprint(len(food_list))'] | ['Wrong Answer', 'Accepted'] | ['s208844048', 's598105968'] | [3064.0, 3064.0] | [17.0, 18.0] | [424, 426] |
p03126 | u243572357 | 2,000 | 1,048,576 | 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. | ['n, m = map(int,input().split())\nans = set(list(range(1, m+1)))\nfor i in range(n):\n k, *a = map(int, input().split())\n ans &= set(a)\n \nprint(ans)', 'n, m = map(int, input().split())\n\nlst = list(range(1, m+1)):\n\nfor _ in range(n):\n for i in lst:\n if i not in list(map(int, input().split()))[1:]:\n lst.pop(lst.index(i))\nprint(len(lst))', 'n, m = map(int, input().split())\n\nlst = list(range(1, m+1)):\n\nfor _ in range(n):\n for i in lst:\n if i not in list(map(int, input().split()))[1:]:\n lst.pop(lst.index(i))\nprint(len(lst))', 'n, m = map(int, input().split())\ns = set(range(1, m+1))\n\nfor i in range(n):\n c, *a = map(int, input().split())\n s &= set(a)\n \nprint(len(s))'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s245571835', 's462107067', 's975980050', 's111483197'] | [3060.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [148, 193, 193, 142] |
p03126 | u253209284 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\ns = set(str(i) for i in range(m))\nfor _ in range(n):\n s = s & set(input().split())\nprint(len(s))', 'n, m = map(int, input().split())\ns = set(range(1, m+1))\nfor _ in range(n):\n s = s & set(int(i) for i in input().split()[1:])\nprint(len(s))'] | ['Wrong Answer', 'Accepted'] | ['s694451945', 's114439671'] | [2940.0, 2940.0] | [17.0, 18.0] | [130, 139] |
p03126 | u254871849 | 2,000 | 1,048,576 | 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. | ['# 2019-11-12 15:53:47(JST)\nimport sys\n# import collections\n# import math\n# from string import ascii_lowercase, ascii_uppercase, digits\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n# import itertools\n# from functools import reduce\n# import operator as op\n# from scipy.misc import comb # float\n# import numpy as np \n\ndef main():\n nm, *lines = sys.stdin.readlines()\n n, m = [int(x) for x in nm.split()]\n likes = [[int(x) for x in line.split()] for line in lines]\n menu = set(range(1, m+1))\n res = menu\n print(res)\n for i in range(n):\n res &= set(likes[i][1:])\n print(res)\n \n print(len(res))\n\nif __name__ == "__main__":\n main()\n', "import sys\n\nn, m = map(int, sys.stdin.readline().split())\ng = [[int(x) for x in sys.stdin.readline().split()[1:]] for _ in range(n)]\n\ndef main():\n res = set(range(1, m+1))\n for a in g:\n res &= set(a)\n \n return len(res)\n\nif __name__ == '__main__':\n ans = main()\n print(ans)"] | ['Wrong Answer', 'Accepted'] | ['s307209119', 's007640132'] | [3060.0, 3060.0] | [18.0, 18.0] | [686, 297] |
p03126 | u256833330 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\nS=set(range(1,m+1))\nfor i in range(n):\n K,*A=map(int,input().split())\n print(A)\n S&=set(A)\nprint(len(S))\n', 'n,m=map(int,input().split())\nl=[]\nfor _ in range(n):\n k,*s=input().split()\n l+=s\nse=set(l)\na=0\nfor i in se:\n c=l.count(i)\n if c==n:\n a+=1\nprint(a)\n'] | ['Wrong Answer', 'Accepted'] | ['s433731208', 's498959681'] | [2940.0, 3060.0] | [18.0, 19.0] | [143, 166] |
p03126 | u259418313 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nfoodlist = [0 for i in range(M)]\nfor i in range(N):\n food = list(map(int, input().split()))\n food.pop(0)\n for items in food:\n foodlist[items-1]+=1\ncnt = 0\nprint(foodlist)\nfor i in range(M):\n if(foodlist[i] == N): cnt+=1\nprint(cnt)', 'N, M = map(int, input().split())\nfoodlist = [0 for i in range(M)]\nfor i in range(N):\n food = list(map(int, input().split()))\n food.pop(0)\n for items in food:\n foodlist[items-1]+=1\ncnt = 0\n\nfor i in range(M):\n if(foodlist[i] == N): cnt+=1\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s873180646', 's893107301'] | [3064.0, 3064.0] | [18.0, 17.0] | [282, 283] |
p03126 | u263830634 | 2,000 | 1,048,576 | 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. | ["N, M = map(int, input().split())\nimport sys\nans = 0\nlst = []\nkari = []\nfor i in range(N):\n if i == 0:\n lst += list(map(int, input().split()))\n lst = lst[1:]\n print (lst)\n else:\n if lst == []:\n print (0)\n sys.exit()\n else: \n kari = list(map(int, input().split()))\n# print ('kari ', kari)\n sakujo = []\n for j in lst:\n if j in kari[1:]:\n pass\n else:\n sakujo += [j]\n\n# print (j)\n for k in sakujo:\n lst.remove(k)\n\n# print ('lst ', lst)\n if lst == []:\n print (0)\n sys.exit()\n\n#print (lst)\nans = len(lst)\nprint (ans)", "N, M = map(int, input().split())\nimport sys\nans = 0\nlst = []\nkari = []\nfor i in range(N):\n if i == 0:\n lst += list(map(int, input().split()))\n lst = lst[1:]\n# print (lst)\n else:\n if lst == []:\n print (0)\n sys.exit()\n else: \n kari = list(map(int, input().split()))\n# print ('kari ', kari)\n sakujo = []\n for j in lst:\n if j in kari[1:]:\n pass\n else:\n sakujo += [j]\n\n# print (j)\n for k in sakujo:\n lst.remove(k)\n\n# print ('lst ', lst)\n if lst == []:\n print (0)\n sys.exit()\n\n#print (lst)\nans = len(lst)\nprint (ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s360163404', 's226600393'] | [3064.0, 3064.0] | [18.0, 18.0] | [869, 871] |
p03126 | u266874640 | 2,000 | 1,048,576 | 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. | ['n,m = map(int, input().split())\nk = [list(map(int, input().split())) for i in range(n)]\nresult = 0\nanswer = 0\nfor i in range(1,m + 1):\n for j in range(n):\n K = k[j]\n for v in range(1,K[0] + 1):\n if K[v] == i:\n result += 1\n if result == n:\n answer += 1\nprint(answer)\n', 'import collections\n\nN,M = map(int,input().split())\nA = [list(map(int,input().split())) for i in range(N)]\nfavorite = []\ncount = 0\n\nfor i in range(1,A[0][0]+1):\n favorite.append(A[0][i])\nfor j in range(1,N):\n for k in range(1, A[j][0]+1):\n if A[j][k] in favorite:\n favorite.append(A[j][k])\n\na = collections.Counter(favorite)\nfor key,value in a.items():\n if value == N:\n count += 1\nprint(count)\n'] | ['Wrong Answer', 'Accepted'] | ['s145827532', 's604202737'] | [3064.0, 3444.0] | [20.0, 22.0] | [319, 427] |
p03126 | u270144704 | 2,000 | 1,048,576 | 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. | ["\n\ndef main():\n\tN,M=map(int,input().split())\n\tlike=[0]*M\n\tfor _ in range(N):\n \tK,*A=map(int,input().split())\n \tfor num in A:\n \tlike[num-1]+=1\nprint(like.count(N))\n\nif __name__=='__main__':\n main()\n\n\n\n\n \n", "def main():\n N,M=map(int,input().split())\n like=[0]*M\n for _ in range(N):\n K,*A=map(int,input().split())\n for num in A:\n like[num-1]+=1\n print(like.count(N))\n\nif __name__=='__main__':\n main()\n\n\n\n\n \n"] | ['Runtime Error', 'Accepted'] | ['s254490091', 's382173896'] | [2940.0, 2940.0] | [17.0, 17.0] | [222, 242] |
p03126 | u273038590 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split(" ")) \nS=set(range(1,m+1))\nfor i in range(n):\n K, *A = map(int, input().split(" "))\u3000\n S &=set(A) \nprint(len(S))', 'n,m=map(int,input().split(" "))\nS=set(range(1,m+1))\nfor i in range(n):\n K, *A = map(int, input().split(" "))\n S &=set(A)\nprint(len(S))'] | ['Runtime Error', 'Accepted'] | ['s710972573', 's660711973'] | [2940.0, 2940.0] | [17.0, 17.0] | [145, 140] |
p03126 | u278260569 | 2,000 | 1,048,576 | 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. | ['N,K = map(int,input().split())\nK_A = []\nfor i in range(N):\n\tK_A.append(list(map(int,input().split())))\n\nl = []\n\nfor i in range(N):\n\tdel K_A[i][0]\n\tfor j in range(len(K_A[i])):\n\t\tl.append(K_A[i][j])\n\t\t\ncount = 0\n\nfor i in range(K+1):\n\tprint(l.count(i),i)\n\tif l.count(i) == N:\n\t\tcount += 1\n\nprint(count)\n', 'N,K = map(int,input().split())\nK_A = []\nfor i in range(N):\n\tK_A.append(list(map(int,input().split())))\n\nl = []\n\nfor i in range(N):\n\tdel K_A[i][0]\n\tfor j in range(len(K_A[i])):\n\t\tl.append(K_A[i][j])\n\t\t\ncount = 0\n\nfor i in range(K+1):\n\tif l.count(i) == N:\n\t\tcount += 1\n\nprint(count)\n'] | ['Wrong Answer', 'Accepted'] | ['s774302575', 's592654930'] | [3064.0, 3064.0] | [18.0, 18.0] | [303, 282] |
p03126 | u286201019 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nm = 0\nfor i in range(M):\n m += 2**i\nfor n in range(N):\n k = list(map(int, input().split()))\n k_n = k[0]\n _m = 0\n for i in range(k_n):\n _m ^= 2**(k[i+1]-1)\n m &= _m\n print(bin(m))\nret = bin(m).count("1")\nprint(ret)', 'N, M = map(int, input().split())\nm = 0\nfor i in range(M):\n m += 2**i\nfor n in range(N):\n k = list(map(int, input().split()))\n k_n = k[0]\n for i in range(k_n):\n m &= 2**k[i+1]\nret = bin(m).count("1")\nprint(ret)', 'N, M = map(int, input().split())\nm = 0\nfor i in range(M):\n m += 2**i\nfor n in range(N):\n k = list(map(int, input().split()))\n k_n = k[0]\n _m = 0\n for i in range(k_n):\n _m ^= 2**(k[i+1]-1)\n m &= _m\nret = bin(m).count("1")\nprint(ret)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s201919740', 's766018146', 's624370499'] | [3316.0, 3060.0, 3064.0] | [22.0, 17.0, 19.0] | [274, 228, 256] |
p03126 | u288430479 | 2,000 | 1,048,576 | 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. | ['N,M = map(int,input().split())\nl = [list(map(int,input().split())) for i\n in range(N)]\nfor i in range(N):\n del l[i][0]\n\nfor i in range(N-1):\n a = set(l[i])&set(l[i+1])\n l[i+1] = a\n if N==1:\n print(len(l[0])) \n print(len(a))\n', 'N,M = map(int,input().split())\nl = [list(map(int,input().split())) for i\n in range(N)]\ndel l[0:N][0]\n#print(l)\nsum = []\nfor i in range(N-1):\n sum += list(set(l[i])&set(l[i+1]))\n\nprint(len(sum))', 'N,M = map(int,input().split())\nl = [list(map(int,input().split())) for i\n in range(N)]\nfor i in range(N):\n del l[i][0]\nif N!=1:\n for i in range(N-1):\n a = set(l[i])&set(l[i+1])\n l[i+1] = a\n print(len(a))\nelse:\n', 'N,M = map(int,input().split())\nl = [list(map(int,input().split())) for i\n in range(N)]\nfor i in range(N):\n del l[i][0]\nif N!=1:\n for i in range(N-1):\n a = set(l[i])&set(l[i+1])\n l[i+1] = a\n print(len(a))\nelse:\n print(len(l))', 'N,M = map(int,input().split())\nl = [list(map(int,input().split())) for i\n in range(N)]\nfor i in range(N):\n del l[i][0]\n\nfor i in range(N-1):\n a = set(l[i])&set(l[i+1])\n l[i+1] = a\nif N==1:\n print(len(l[0])) \nelse:\n print(len(a))'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s248984857', 's739444957', 's839085462', 's848285617', 's463396803'] | [3060.0, 3060.0, 2940.0, 3060.0, 3316.0] | [18.0, 18.0, 18.0, 18.0, 20.0] | [247, 198, 225, 240, 241] |
p03126 | u294385082 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input().split())\nkx = [list(map(int,input().split())) for i in range(n)]\nc1 = 0\nc2 = 0\n\nfor i in kx[0]:\n for j in range(1,n):\n if i in kx[j]:\n c1 += 1\n if c1 == n-1:\n c2 += 1\n c1 = 0\n\nprint(c2)', 'n,m = map(int,input().split())\nkx = [list(map(int,input().split())) for i in range(n)]\nc1 = 0\nc2 = 0\n \nfor i in kx[0]:\n for j in range(1,n):\n if i in kx[j]:\n c1 += 1\n if c1 == n-1:\n c2 += 1\n c1 = 0\nprint(c2)', 'n,m = map(int,input().split())\nkx = [list(map(int,input().split())) for i in range(n)]\nc1 = 0\nc2 = 0\n\nfor i in range(1,len(kx[0])):\n for j in range(1,n):\n if kx[0][i] in kx[j][1:]:\n c1 += 1\n if c1 == n-1:\n c2 += 1\n c1 = 0\n\nprint(c2)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s134884818', 's909919901', 's879187588'] | [3060.0, 3060.0, 3064.0] | [18.0, 18.0, 18.0] | [221, 221, 246] |
p03126 | u296783581 | 2,000 | 1,048,576 | 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. | ['N,M = map(int, input().split())\nK = list(map(int, input().split()))\ndel K[0]\nfor i in range(N):\n k = list(map(int, input().split()))\n del k[0]\n K = list(set(k) & set(K))\nprint(len(K))\n', 'N,M = map(int, input().split())\nK = list(map(int, input().split()))\ndel K[0]\nfor i in range(N - 1):\n k = list(map(int, input().split()))\n del k[0]\n K = list(set(k) & set(K))\nprint(len(K))'] | ['Runtime Error', 'Accepted'] | ['s034737936', 's161646236'] | [3060.0, 3060.0] | [18.0, 17.0] | [193, 196] |
p03126 | u297757054 | 2,000 | 1,048,576 | 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. | ['K = [None]*30\nA = [None]*30\nMs = [0]*31\ndef main():\n N, M = map(int, input().split())\n for i in range(N):\n K[i], *A[i], = map(int, input().split())\n for i in A:\n if i == None:\n break\n for j in i:\n print(j)\n Ms[j] += 1\n print(Ms.count(N))\n\nmain()\n', 'K = [None]*30\nA = [None]*30\nMs = [0]*31\ndef main():\n N, M = map(int, input().split())\n for i in range(N):\n K[i], *A[i], = map(int, input().split())\n for i in A:\n if i == None:\n break\n for j in i:\n Ms[j] += 1\n print(Ms.count(N))\n\nmain()\n'] | ['Wrong Answer', 'Accepted'] | ['s416037834', 's723636504'] | [3188.0, 3060.0] | [19.0, 18.0] | [312, 291] |
p03126 | u299730702 | 2,000 | 1,048,576 | 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. | ["N, M = map(int, input().split())\nprint(N, M)\n\ndef main():\n cnts = [0]*M\n ans = 0\n\n for i in range(N):\n A = list(map(int, input().split()))[1:]\n for a in A:\n cnts[a-1] += 1\n\n for cnt in cnts:\n if cnt == N:\n ans += 1\n return ans\n\n\nif __name__ == '__main__':\n print(main())\n", "N, M = map(int, input().split())\n\ndef main():\n cnts = [0]*M\n ans = 0\n\n for i in range(N):\n A = list(map(int, input().split()))[1:]\n for a in A:\n cnts[a-1] += 1\n\n for cnt in cnts:\n if cnt == N:\n ans += 1\n return ans\n\n\nif __name__ == '__main__':\n print(main())\n"] | ['Wrong Answer', 'Accepted'] | ['s352372472', 's514446177'] | [3060.0, 3060.0] | [17.0, 18.0] | [332, 320] |
p03126 | u302292660 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input.split())\nS = set(range(1,m+1))\nfor i in range(n):\n a,*b = map(int,input().split())\n S &= set(b)\nprint(len(S))\n ', 'n,m = map(int,input().split())\nS = set(range(1,m+1))\nfor i in range(n):\n a,*b = map(int,input().split())\n S &= set(b)\nprint(len(S))\n '] | ['Runtime Error', 'Accepted'] | ['s934767937', 's722251386'] | [2940.0, 2940.0] | [17.0, 17.0] | [134, 136] |
p03126 | u310678820 | 2,000 | 1,048,576 | 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. | ['n,m = map(int, input().split())\nq=[input() for i in range(n)]\nl=[i+1 for i in range(m)]\nl1=[i+1 for i in range(m)]\nfor i in q:\n t=list(map(int, i.split()))\n for k in l1:\n if (k not in t[1:]):\n l.remove(k)\nprint(len(l))\n', 'n,m = map(int, input().split())\nq=[input() for i in range(n)]\nl=[i+1 for i in range(m)]\nl1=[i+1 for i in range(m)]\nfor i in q:\n t=list(map(int, i.split()))\n for k in l1:\n if (k not in t[1:]):\n if k in l:\n \tl.remove(k)\nprint(len(l))\n'] | ['Runtime Error', 'Accepted'] | ['s742029742', 's439705134'] | [3060.0, 3060.0] | [19.0, 21.0] | [229, 247] |
p03126 | u317779196 | 2,000 | 1,048,576 | 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. | ['import numpy as np\nn,m = map(int, input().split())\narr = np.zeros(m)\nfor i in range(n):\n ka = np.array([int(i) for i in input().split()])\n for j in range(ka[0]):\n arr[ka[j+1]-1] = 1\nans = int(arr.sum())\nprint(ans)', 'import numpy as np\nn,m = map(int, input().split())\narr = np.zeros(m)\nfor i in range(n):\n ka = np.array([int(i) for i in input().split()])\n for j in range(ka[0]):\n arr[ka[j+1]-1] += 1\nans = (arr == n).sum()\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s111813616', 's589620245'] | [26248.0, 27208.0] | [116.0, 121.0] | [226, 229] |
p03126 | u322297639 | 2,000 | 1,048,576 | 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. | ['import collections\nn, m = map(int, input().split())\na_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])\ncol = collections.Counter(a_list)\nprint(sum([k for k, v in col.items() if v == n]))', 'import collections\nn, m = map(int, input().split())\na_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])\ncol = collections.Counter(a_list)\nprint(len([k for k, v in col.items() if v == n]))'] | ['Wrong Answer', 'Accepted'] | ['s534370038', 's939484020'] | [3316.0, 3316.0] | [22.0, 21.0] | [209, 209] |
p03126 | u325119213 | 2,000 | 1,048,576 | 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. | ['5 5\n4 2 3 4 5\n4 1 3 4 5\n4 1 2 4 5\n4 1 2 3 5\n4 1 2 3 4', 'def actual(N, M, K, A):\n \n s = set(A[0])\n\n for a in A[1:]:\n s &= set(a)\n\n return len(s)\n\n\nN, M = map(int, input().split())\n\nK = []\nA = []\n\nfor _ in range(N):\n ka = list(map(int, input().split()))\n K.append(ka[0])\n A.append(ka[1:])\n\nprint(actual(N, M, K, A))\n'] | ['Runtime Error', 'Accepted'] | ['s419442290', 's509679757'] | [2940.0, 3060.0] | [17.0, 19.0] | [53, 331] |
p03126 | u329058683 | 2,000 | 1,048,576 | 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. | ['N,M=map(int,input().split())\nL=[]\nfor i in range(N):\n a=list(map(int,input().split()))\n for b in a:\n L.append(b)\nans=0\nfor i in range(30):\n if L.count(i)==N:\n ans=ans+1\nprint(ans)', 'N,M=map(int,input().split())\nL=[]\nfor i in range(N):\n a=list(map(int,input().split()))\n for b in a[1:]:\n L.append(b)\nans=0\nfor i in range(31):\n if L.count(i)==N:\n ans=ans+1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s128647042', 's856472500'] | [3060.0, 3060.0] | [18.0, 18.0] | [188, 192] |
p03126 | u342051078 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input())\nnum = [list(map(int,input().split())) for i in range(n)]\nl = [0]*m\nfor i in range(n):\n for j in num[i][1:]:\n l[j-1] += 1\nprint(l.count(n))', 'n,m = map(int,input().split())\nnum = [list(map(int,input().split())) for i in range(n)]\nl = [0]*m\nfor i in range(n):\n for j in num[i][1:]:\n l[j-1] += 1\nprint(l.count(n))'] | ['Runtime Error', 'Accepted'] | ['s009188597', 's739108999'] | [3060.0, 3060.0] | [17.0, 17.0] | [171, 179] |
p03126 | u344959886 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\na=[]\nans=0\nfor i in range(n):\n for j in map(int,input().split()):\n a.append(j)\n\nfor k in range(m):\n if a.count(k) == m:\n ans+=1\nprint(ans)\n \n\n ', 'n,m=map(int,input().split())\na=[]\nans=0\nfor i in range(n):\n ii=0\n for j in map(int,input().split()):\n if ii > 0:\n \ta.append(j)\n ii+=1\n#print(a)\n \nfor k in range(1,m+1):\n if a.count(k) == n:\n ans+=1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s087719788', 's346930828'] | [2940.0, 3060.0] | [18.0, 18.0] | [198, 245] |
p03126 | u346629192 | 2,000 | 1,048,576 | 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. | ['N,M = map(int,input().split())\nnum = []\nfor i in range(N):\n num.append(list(map(int,input().split()[1:])))\ncount = 0\nfor j in range(1,M+1):\n if all(j in num[i] for i in range(N)):\n count += 1\nprint(count) \nprint(num)', 'N,M = map(int,input().split())\nnum = []\nfor i in range(N):\n num.append(list(map(int,input().split()[1:])))\ncount = 0\nfor j in range(1,M+1):\n if all(j in num[i] for i in range(N)):\n count += 1\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s763763021', 's016155068'] | [3064.0, 3060.0] | [18.0, 18.0] | [231, 217] |
p03126 | u346851130 | 2,000 | 1,048,576 | 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. | ["#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport numpy\n\n\ndef main():\n n, m = list(map(int, input().split()))\n a = numpy.ones(m)\n\n for _ in range(n):\n b = numpy.zeros(m)\n b[list(map(lambda x: int(x) - 1, input().split()))[1:]] = 1\n a *= b\n\n print(a)\n print(int(numpy.sum(a)))\n\n\nif __name__ == '__main__':\n main()\n\n", "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport numpy\n\n\ndef main():\n n, m = list(map(int, input().split()))\n a = numpy.ones(m)\n\n for _ in range(n):\n b = numpy.zeros(m)\n b[list(map(lambda x: int(x) - 1, input().split()))[1:]] = 1\n a *= b\n\n print(int(numpy.sum(a)), flush=True)\n\n\nif __name__ == '__main__':\n main()\n\n"] | ['Wrong Answer', 'Accepted'] | ['s046494922', 's198352304'] | [12504.0, 12504.0] | [151.0, 149.0] | [332, 333] |
p03126 | u347452770 | 2,000 | 1,048,576 | 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. | ['n,m = map(int, input().split()) \n\ncounter = []\nans = 0\nfor i in range(m):\n counter.apeend(0)\n\nfor i in range(n):\n ls = [map(int, input().split())]\n for i in range(1, ls[0]+1):\n num = counter[ls[i] - 1]\n counter.insert(ls[i]-1, num + 1)\nfor i in range(m):\n if counter[i] == n:\n ans += 1\nprint(ans)\n\n', 'n,m = map(int, input().split()) \n \ncounter = []\nans = 0\nfor i in range(m):\n counter.append(0)\n \nfor i in range(n):\n ls = list(map(int, input().split()))\n kazu = ls[0]\n for i in range(1, kazu+1):\n num = counter[ls[i] - 1]\n counter[ls[i]-1] = num + 1\nfor i in range(m):\n if counter[i] == n:\n ans += 1\nprint(ans)\n '] | ['Runtime Error', 'Accepted'] | ['s155796192', 's546663759'] | [3060.0, 3064.0] | [17.0, 18.0] | [330, 344] |
p03126 | u347600233 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\nall = {int(i) for i in range(1, i + 1)}\nfor _ in range(n):\n k, *i_th = map(int, input().split())\n all &= set(list(i_th))\nprint(len(all))', 'n, m = map(int, input().split())\nall = {int(i) for i in range(1, m + 1)}\nfor _ in range(n):\n k, *i_th = map(int, input().split())\n all &= set(i_th)\nprint(len(all))'] | ['Runtime Error', 'Accepted'] | ['s621342256', 's216618144'] | [3060.0, 2940.0] | [17.0, 18.0] | [175, 169] |
p03126 | u350093546 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\nx=[]\nsum=0\nfor i in range(n):\n s=list(map(int,input().split()))\n x+=s\nfor i in range(1,m+1):\n if x.count(i)==n:\n sum+=1\nprint(sum)', 'n,m=map(int,input().split())\nx=[]\nsum=0\nfor i in range(n):\n s=list(map(int,input().split()))\n s.pop(0)\n x+=s\nfor j in range(1,m+1):\n if x.count(j)==n:\n sum+=1\nprint(sum)\n'] | ['Wrong Answer', 'Accepted'] | ['s812996887', 's622067334'] | [3060.0, 3060.0] | [18.0, 18.0] | [165, 177] |
p03126 | u350697094 | 2,000 | 1,048,576 | 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. | ['import collections\nimport itertools\n\nN, M=map(int, input().split())\na = []\nfor i in range(N):\n b = []\n b = list(map(int, input().split()))\n del b[0]\n a.extens(b)\n\ncounter = collections.Counter(a)\n\nmode_v = counter.most_common()[0][-1]\nit = itertools.takewhile(\n lambda kv: kv[-1] == mode_v, counter.most_common()\n)\nif len(it)>=N:\n\tprint(len(it)>=N)\nelse:\n \tprint(0)\n \n \n \n ', 'N, M=map(int, input().split())\na = []\nfor i in range(N):\n b = []\n b = list(map(int, input().split()))\n del b[0]\n a.extend(b)\n \nc=Counter(a)\n \nfreq_scores = c.most_common()\n \nmax_count = freq_scores[0][1]\n\nmodes = []\n \u3000\nfor num in freq_scores:\n\tif num[1] == max_count:\n \tmodes.append(num[0])\n\nprint(len(a[modes]))\n', 'import collections\nimport itertools\n\nN, M=map(int, input().split())\na = []\nfor i in range(N):\n b = []\n b = list(map(int, input().split()))\n del b[0]\n a.extend(b)\n\ncounter = collections.Counter(a)\n\nret = [letter for letter,count in counter.most_common() if count == counter.most_common()[0][1]]\nif N == counter.most_common()[0][1]:\n\tprint(len(ret))\nelse:\n print(0)\n '] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s689763274', 's791281178', 's982094978'] | [3316.0, 2940.0, 3316.0] | [20.0, 17.0, 21.0] | [382, 550, 370] |
p03126 | u352558780 | 2,000 | 1,048,576 | 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. | ['n,m = [int(i) for i in input().split()]\ne = [[int(i) for i in input().split()] for i in range(n)]\n\ns=[]\nfor t in e:\n b_list=0\n for x in t[1:]:\n b_list = b_list | pow(2,x-1)\n s.append(b_list)\nresult=pow(2,30)-1\nfor i in s:\n result = result & i\ncnt=0\nfor i in range(30):\n if result & pow(2,i):\n cnt+=1\n', 'n,m = [int(i) for i in input().split()]\ne = [[int(i) for i in input().split()] for i in range(n)]\n\ns=[]\nfor t in e:\n b_list=0\n for x in t[1:]:\n b_list = b_list | pow(2,x-1)\n s.append(b_list)\nresult=pow(2,30)-1\nfor i in s:\n result = result & i\ncnt=0\nfor i in range(30):\n if result & pow(2,i):\n cnt+=1\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s824733003', 's580005661'] | [3064.0, 3064.0] | [18.0, 19.0] | [312, 322] |
p03126 | u360515075 | 2,000 | 1,048,576 | 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. | ["N, M = map(int, input().split())\n\na = set(str(x) for x in range(1,M+1))\nfor i in range(N):\n li = list(input().split())\n a = a & set(li[1:])\n\nprint (' '.join(a))", 'N, M = map(int, input().split())\n\na = set(str(x) for x in range(1,M+1))\nfor i in range(N):\n li = list(input().split())\n a = a & set(li[1:])\n\nprint (len(a))'] | ['Wrong Answer', 'Accepted'] | ['s911925300', 's394052472'] | [3188.0, 3060.0] | [19.0, 17.0] | [162, 157] |
p03126 | u366677622 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nA0 = list(map(int, input().split()))\nA0.pop(0)\nfor i in range(N-1):\n A = list(map(int, input().split()))\n for j in A0:\n \n if j not in A[1:]:\n A0.remove(j)\n print(A0)\n\nprint(len(A0))', 'N, M = map(int, input().split())\nA0 = list(map(int, input().split()))\n\nfor i in range(N-1):\n A = list(map(int, input().split()))\n for j in A0[1:]:\n if j not in A[1:]:\n A0.remove(j)\n print(A0)\n\nprint(len(A0[1:]))', 'N, M = map(int, input().split())\ncnt = [0]*M\nfor i in range(N):\n A = list(map(int, input().split()))\n for j in A[1:]:\n cnt[j-1] += 1\n\nans = 0\nfor i in range(M):\n if cnt[i]==N:\n ans += 1\n \nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s613120846', 's655772011', 's213218289'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 17.0] | [256, 246, 228] |
p03126 | u368796742 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input().split())\nans = [0]*(m+1)\nfor i in range(n):\n l = list(map(int,input().split()))\n for j in range(1,l[1]+1):\n ans[l[j]] += 1\n \nfor i in ans:\n if i == n:\n count += 1\nprint(count)\n \n ', 'n,m = map(int,input().split())\nans = [0]*(m+1)\ncount = 0\nfor i in range(n):\n l = list(map(int,input().split()))\n for j in range(1,l[0]+1):\n ans[l[j]] += 1\n \nfor i in ans:\n if i == n:\n count += 1\nprint(count)\n \n \n'] | ['Runtime Error', 'Accepted'] | ['s174421544', 's995648771'] | [3060.0, 3060.0] | [18.0, 18.0] | [227, 238] |
p03126 | u371467115 | 2,000 | 1,048,576 | 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. | ['s,m=map(int,input().split())\nl=[]\nfor _ in range(s):\n n=[]\n n=list(map(int,input().split()))\n n.pop(0)\n l=l+n\nm=dict()\nfor i in l:\n if i in m:\n m[i]+=1\n else:\n m[i]=1\n print(m)\ncnt=0\nfor j in m:\n if m[j]==s:\n cnt+=1\nprint(cnt)', 's,m=map(int,input().split())\nl=[]\nfor _ in range(s):\n n=[]\n n=list(map(int,input().split()))\n n.pop(0)\n l=l+n\nm=dict()\nfor i in n:\n if i in m:\n m[i]+=1\n else:\n m[i]=1\ncnt=0\nfor j in m:\n if m[j]==s:\n cnt+=1\nprint(cnt)\n ', 's,m=map(int,input().split())\nl=[]\nfor _ in range(s):\n n=[]\n n=list(map(int,input().split()))\n n.pop(0)\n l=l+n\nm=dict()\nfor i in l:\n if i in m:\n m[i]+=1\n else:\n m[i]=1\ncnt=0\nfor j in m:\n if m[j]==s:\n cnt+=1\nprint(cnt)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s401428464', 's799463478', 's791796388'] | [3188.0, 3064.0, 3060.0] | [22.0, 17.0, 19.0] | [243, 235, 233] |
p03126 | u391875425 | 2,000 | 1,048,576 | 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. | ['def read():\n return int(input())\n\ndef reads():\n return list(map(int, input().split()))\n\nn, m = reads()\na = set(reads()[1:])\nfor _ in range(n - 1):\n a &= set(input().split()[1:])\nprint(len(a))', 'n, m = map(int, input().split())\na = set(input().split()[1:])\nfor i in range(n - 1):\n a &= set(reads()[1:])\nprint(len(a))', 'n, m = map(int, input().split())\na = set(input().split()[1:])\nfor i in range(n - 1):\n a &= set(input().split()[1:])\nprint(len(a))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s604184735', 's730636718', 's281250607'] | [3060.0, 2940.0, 3064.0] | [17.0, 18.0, 17.0] | [198, 124, 132] |
p03126 | u394519598 | 2,000 | 1,048,576 | 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. | ['import numpy as np\n\nN, M = map(int, input().split())\nA = np.full((N, M), 0)\nfor i in range(N):\n Ka = map(int, input().split())\n a = Ka[1:]\n for j in a:\n A[i, j-1] = 1\n \nprint(np.sum(np.prod(A, axis=0)))\n ', 'N, M = map(int, input().split())\n\nlike = [1] * M\n\nfor i in range(N):\n K, *A = map(int, input().split())\n for i in range(M):\n if i + 1 not in A:\n like[i] = 0\nprint(sum(like))\n '] | ['Runtime Error', 'Accepted'] | ['s774511277', 's152898446'] | [12504.0, 2940.0] | [147.0, 18.0] | [234, 202] |
p03126 | u394716224 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\n\nK = [list(map(int, input().split())) for row in range(N)]\nif N = 1:\n\tprint(K[0][0])\nelse:\n\tfor i in range(N):\n\t\tK[i].pop(K[i][0])\n\n\tfoods = set(K[0])\n\ti = 0\n\twhile i < N:\n\t\tfoods = foods.intersection(set(K[i]))\n\t\tif foods == set():\n\t\t\tbreak\n\t\t\n\t\telse:\n\t\t\ti += 1\n\tprint(len(list(foods)))\n\n\n\n', 'N, M = map(int, input().split())\n\nK = [list(map(int, input().split())) for row in range(N)]\nif N = 1:\n\tprint(K[0][0])\nelse:\n\tfor i in range(N):\n\t\tK[i].pop(K[i][0])\n\n\tfoods = set(K[0])\n\ti = 0\n\twhile i < N:\n\t\tfoods = foods.intersection(set(K[i]))\n\t\tif foods == set():\n\t\t\tbreak\n\t\t\n\t\telse:\n\t\t\ti += 1\n\tprint(len(list(foods)))\n\n\n\n', 'N, M = map(int, input().split())\n\nK = [list(map(int, input().split())) for row in range(N)]\nif N = 1:\n\tprint(K[0][0])\nelse:\n\tfor i in range(N):\n\t\tK[i].pop(K[i][0])\n\n\tfoods = set(K[0])\n\ti = 0\n\twhile i < N:\n\t\tfoods = foods.intersection(set(K[i]))\n\t\tif foods == set():\n\t\t\tbreak\n\t\t\n\t\telse:\n\t\t\ti += 1\n\tprint(len(list(foods)))\n\n\n\n', 'N, M = map(int, input().split())\n\nK = [list(map(int, input().split())) for row in range(N)]\nif N == 1:\n\tprint(K[0][0])\nelse:\n\tfor i in range(N):\n\t\tK[i].remove(K[i][0])\n\n\tfoods = set(K[0])\n\ti = 0\n\twhile i < N:\n\t\tfoods = foods.intersection(set(K[i]))\n\t\tif foods == {}:\n\t\t\t\n\t\t\tbreak\n\t\t\texit()\n\t\ti += 1\n\tprint(len(list(foods)))\n\n\n\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s141106521', 's178415560', 's596453872', 's780971229'] | [2940.0, 2940.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 18.0] | [324, 324, 324, 327] |
p03126 | u396391104 | 2,000 | 1,048,576 | 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. | ['n,m = map(int,input().split())\nans = [0]*m\ni = j = 0\nfor i in range(n):\n a = list(map(int,input().split()))\n for j in range(1,a[0]+1):\n ans[a[j]-1] += 1\n print(ans)\nprint(ans.count(n))', 'n,m = map(int,input().split())\nans = [0]*m\ni = j = 0\nfor i in range(n):\n a = list(map(int,input().split()))\n for j in range(1,a[0]+1):\n ans[a[j]-1] += 1\nprint(ans.count(n))'] | ['Wrong Answer', 'Accepted'] | ['s564477361', 's296346731'] | [3060.0, 3060.0] | [18.0, 18.0] | [190, 177] |
p03126 | u399388436 | 2,000 | 1,048,576 | 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. | ['N,M=map(int,input().split())\ndata = [input().split() for i in range(N)] \n# print(len(data))\nresult=[]\nfor j in range(N):\n result=result+data[j][1:]\n# print(result)\nresult=[int(s) for s in result]\nans=[x for x in result if result.count(x) == N]\nprint(len(ans))', 'N,M=map(int,input().split())\ndata = [input().split() for i in range(N)] \n# print(len(data))\nresult=[]\nfor j in range(N):\n result=result+data[j][1:]\n# print(result)\nans=[x for x in result if result.count(x) == N]\nprint(len(ans))', 'N,M=map(int,input().split())\ndata = [input().split() for i in range(N)] \nresult=[]\nfor j in range(N):\n result=result+data[j][1:]\nresult=[int(s) for s in result]\nans=[x for x in result if result.count(x) == N]\nprint(int(len(ans)/N))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s612729950', 's937997396', 's292474568'] | [3064.0, 3060.0, 3060.0] | [28.0, 32.0, 28.0] | [262, 230, 235] |
p03126 | u411435121 | 2,000 | 1,048,576 | 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. | ['import fractions\nfrom functools import reduce\n\ndef gcd(numbers):\n return reduce(fractions.gcd, numbers)\n\nn = int(input())\nprint(gcd(list(map(int, input().split()))))', 'import fractions\nfrom functools import reduce\n\ndef gcd(numbers):\n return reduce(fractions.gcd, numbers, 1)\n\nn = int(input())\nprint(gcd(list(map(int, input().split()))))', 'n, m = map(int, input().split())\ntemp = list(map(int, input().split()))\ntemp = set(temp[1:])\nfor i in range(n-1):\n\ttemp2 = list(map(int, input().split()))\n\ttemp2 = set(temp2[1:])\n\ttemp = temp.intersection(temp2)\nprint(len(temp))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s162540163', 's301314056', 's438155451'] | [5048.0, 5048.0, 3060.0] | [36.0, 36.0, 18.0] | [168, 171, 228] |
p03126 | u415325136 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nL = list()\nans = list()\nfor i in range(N):\n l = [int(_) for _ in input().split()]\n for j in range(len(l[0])):\n ans.append(l[j+1])\n l = L.copy()\ncnt = 0\nnum = 0\ns = -1\nans.sort()\nfor k in ans:\n if s == k:\n cnt += 1\n if cnt == N:\n num += 1\n cnt = 0\n else:\n cnt = 1\n s = k\nprint(num)\n ', 'N,M=map(int,input().split())\na=[0]*(M+1)\nfor i in range(N):\n l=list(map(int,input().split()))\n for j in range(l[0]):\n a[l[j+1]]+=1\nprint(a.count(N))\n'] | ['Runtime Error', 'Accepted'] | ['s645736169', 's296306318'] | [3064.0, 2940.0] | [17.0, 18.0] | [348, 154] |
p03126 | u417027396 | 2,000 | 1,048,576 | 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. | ['N, M= (int(i) for i in input().split())\nfor num in range(N):\n lst[num] = [int(i) for i in input().split()]\n \nfood = np.zeros((N,M))\nfor i in range(N):\n for j in range(lst[i][0]):\n #print(lst[i][j+1])\n food[i][lst[i][j+1]-1] = 1\n#print(food)\ns = np.sum(food, axis=0)\nprint(len(s[s==N]))', 'N, M= (int(i) for i in input().split())\nlst = [[int(i) for i in input().split()] for i in range(n)] \n\nimport numpy as np\nfood = np.zeros((N,M))\nfor i in range(N):\n for j in range(lst[i][0]):\n #print(lst[i][j+1])\n food[i][lst[i][j+1]-1] = 1\n#print(food)\ns = np.sum(food, axis=0)\nprint(len(s[s==N]))', 'N, M= (int(i) for i in input().split())\nlst = [[int(i) for i in input().split()] for i in range(n)] \nimport numpy as np\nfood = np.zeros((N,M))\nfor i in range(N):\n for j in range(lst[i][0]):\n #print(lst[i][j+1])\n food[i][lst[i][j+1]-1] = 1\n#print(food)\ns = np.sum(food, axis=0)\nprint(len(s[s==N]))', 'N, M= (int(i) for i in input().split())\nlst = [[int(i) for i in input().split()] for i in range(n)]', 'N, M= (int(i) for i in input().split())\nlst = [[int(i) for i in input().split()] for i in range(N)]\nimport numpy as np\nfood = np.zeros((N,M))\nfor i in range(N):\n for j in range(lst[i][0]):\n #print(lst[i][j+1])\n food[i][lst[i][j+1]-1] = 1\n#print(food)\ns = np.sum(food, axis=0)\nprint(len(s[s==N]))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s181705774', 's250650393', 's264183345', 's915027516', 's156338107'] | [3064.0, 3064.0, 3064.0, 2940.0, 12488.0] | [17.0, 17.0, 17.0, 17.0, 149.0] | [308, 314, 313, 99, 312] |
p03126 | u425183902 | 2,000 | 1,048,576 | 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. | ['N, M = (int(i) for i in input().split())\nhoge = set((int(i) for i + 1 in range(M)))\nfor i in range(N):\n likes[i] = set()\n likes[i].add((int(i) for i in input().split()))\n hoge &= likes[i]\n\nc = len(hoge)\n\nprint(hoge)', 'N, M = (int(i) for i in input().split())\nhoge = {i for i + 1 in range(M)}\nfor i in range(N):\n likes[i] = set()\n likes[i] = {i for i in input().split()}\n hoge &= likes[i]\n\nc = len(hoge)\n\nprint(hoge)', 'N, M = (int(i) for i in input().split())\nhoge = {i + 1 for i in range(M)}\nprint(hoge)\nfor i in range(N):\n likes = set()\n on = input().split()\n on.pop(0)\n likes = {int(j) for j in on}\n print(likes)\n hoge &= likes\n print("result")\n print(hoge)\n\nc = len(hoge)\n\nprint(c)', 'N, M = (int(i) for i in input().split())\nhoge = {i + 1 for i in range(M)}\n\nfor i in range(N):\n likes = set()\n on = input().split()\n on.pop(0)\n likes = {int(j) for j in on}\n hoge &= likes\n\n\nc = len(hoge)\n\nprint(c)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s689454304', 's773027573', 's874454908', 's099677425'] | [3064.0, 3056.0, 3060.0, 3060.0] | [18.0, 18.0, 19.0, 18.0] | [224, 206, 291, 228] |
p03126 | u430223993 | 2,000 | 1,048,576 | 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. | ['n, m= map(int, input().split())\nka = [input() for i in range(n)]\ncommon = {i for i in range(1,m+1)}\nfor k in ka:\n tmp = [int(i) for i in k.split()]\n tmp = set(tmp)\n common = common.intersection(tmp)\n\nprint(len(common))', 'n, m= map(int, input().split())\nka = [input() for i in range(n)]\ncommon = {i for i in range(1,m+1)}\nfor k in ka:\n tmp = k.split()\n tmp = set(tmp[1:])\n common = common.intersection(tmp)\n\nprint(len(common))', 'n, m= map(int, input().split())\nka = [input() for i in range(n)]\ncommon = {i for i in range(1,m+1)}\nfor k in ka:\n tmp = {int(i) for i in k.split()[1:]}\n common = common.intersection(tmp)\n\nprint(len(common))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s314400913', 's868924340', 's878171398'] | [3060.0, 3060.0, 3060.0] | [18.0, 18.0, 17.0] | [227, 213, 212] |
p03126 | u434872492 | 2,000 | 1,048,576 | 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. | ['N, M = map(int,input().split())\n\nlike_count = [0 for _ in range(m+1)]\n\nfor _ in range(N):\n tmp = list(map(int,input().split()))\n like_list = tmp[1:]\n for like in like_list:\n like_count[like] += 1\n\ncount = 0\nfor value in like_count:\n if value == N:\n count += 1\n\nprint(count)', 'N, M = map(int,input().split())\n\n\nlike_count = [0 for _ in range(M+1)]\n\nfor _ in range(N):\n tmp = list(map(int,input().split()))\n like_list = tmp[1:]\n for like in like_list:\n like_count[like] += 1\n\ncount = 0\nfor value in like_count:\n if value == N:\n count += 1\n\nprint(count)'] | ['Runtime Error', 'Accepted'] | ['s591040107', 's750379984'] | [3060.0, 3060.0] | [18.0, 17.0] | [299, 300] |
p03126 | u437215432 | 2,000 | 1,048,576 | 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. | ['import numpy as np\nn, m = map(int, input().split())\nk = [0] * n\nfor i in range(n):\n k[i] = list(map(int, input().split()))\nb = np.zeros((n, m))\nfor i in range(n):\n w = k[i]\n for j in range(len(w)):\n b[i, int(w[j])-1] = 1\nprint(sum(b.sum(axis=0) == n))\n', 'import numpy as np\nn, m = map(int, input().split())\nk = [0] * n\nfor i in range(n):\n k[i] = list(map(int, input().split()))\nb = np.zeros((n, m))\nfor i in range(n):\n w = a[i]\n for j in range(len(w)):\n b[i, int(w[j])-1] = 1\nprint(sum(b.sum(axis=0) == n))\n', 'import numpy as np\nn, m = map(int, input().split())\nk = [0] * n\nfor i in range(n):\n k[i] = list(map(int, input().split()))\n\nb = np.zeros((n, m))\nfor i in range(n):\n w = k[i]\n for j in range(1, len(w)):\n b[i, int(w[j])-1] = 1\nprint(sum(b.sum(axis=0) == n))\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s260948599', 's768175598', 's986915730'] | [21424.0, 12392.0, 12408.0] | [306.0, 156.0, 157.0] | [268, 268, 272] |
p03126 | u439312138 | 2,000 | 1,048,576 | 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. | ['N,M = map(int,input().split())\n\nans = 0\ni_list = []\n\nfor i in range(N):\n\ttmp_list = list(map(int,input().split()))\n\ti_list.extend(tmp_list[1:])\n\tprint(i_list)\n\nfor i in range(1,M+1):\n if i_list.count(i) == N:\n ans += 1\n\nprint(ans)', 'N,M = map(int,input().split())\n\nans = 0\ni_list = []\n\nfor i in range(N):\n\ttmp_list = list(map(int,input().split()))\n\ti_list.extend(tmp_list[1:])\n\nfor i in range(1,M+1):\n if i_list.count(i) == N:\n ans += 1\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s652864019', 's259628321'] | [3060.0, 3060.0] | [19.0, 18.0] | [234, 219] |
p03126 | u448655578 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nerase = {}\nfor i in range(N):\n a = list(map(int, input().split())) #a = [2,1,3] -> a = [3,1,2,3]\n \n if i == 0:\n food = a[1:] #food = [1] -> food = [1,3]\n else:\n for j in range(len(food)): \n if food[j] not in a[1:]:\n erase.add(food[j])\nprint(len(food)-len(erase)) \n', 'N, M = map(int, input().split())\nerase = {}\nfor i in range(N):\n a = list(map(int, input().split())) #a = [2,1,3] -> a = [3,1,2,3]\n \n if i == 0:\n food = a[1:] #food = [1] -> food = [1,3]\n else:\n for j in range(len(food)): \n if food[j] not in a[1:]:\n erase.add(j)\nprint(len(food)-len(erase)) \n', 'N, M = map(int, input().split())\nerase = {}\nfor i in range(N):\n a = list(map(int, input().split()))\n \n if i == 0:\n food = a[1:]\n else:\n for j in range(len(food)): \n if food[j] not in a[1:]:\n erase.add(food[j])\nprint(len(food)-len(erase)) \n', 'N, M = map(int, input().split())\nerase = set()\nfor i in range(N):\n a = list(map(int, input().split())) \n \n if i == 0:\n food = a[1:]\n for j in range(len(food)): \n \n if food[j] not in a[1:]:\n erase.add(j)\n\nprint(len(food)-len(erase)) '] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s255283222', 's461001787', 's940039669', 's832025692'] | [3060.0, 3064.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0, 18.0] | [354, 348, 296, 281] |
p03126 | u448659077 | 2,000 | 1,048,576 | 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. | ['#ABC118\n\nn,m = list(map(int,input().split()))\nfood = [0] * m\nfor i in range(n):\n a = list(map(int,input().split()))\n for j in a[1:]:\n food[j-1] += 1\n \nl = [food[i] for i in range(len(food)) if food[i] == n]\nprint(l,len(l))', '#ABC118\n\nn,m = list(map(int,input().split()))\nfood = [0] * m\nfor i in range(n):\n a = list(map(int,input().split()))\n for j in a[1:]:\n food[j-1] += 1\n \nl = [food[i] for i in range(len(food)) if food[i] == n]\nprint(len(l))'] | ['Wrong Answer', 'Accepted'] | ['s880711665', 's959504352'] | [3060.0, 3064.0] | [17.0, 17.0] | [242, 240] |
p03126 | u455642216 | 2,000 | 1,048,576 | 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. | ['x,y = map(int,input().split())\na = []\nn=int,input()\nfor i in range(n):\n b = list(map(int,input().split()))\n a.append(b[1:])\nc = [i for i in range (1,m+1)]\nfor i in a:\n for j in range(m):\n if c[j] not in i:\n c[j]=0\nprint(m-c.count(0))', 'x,y = map(int,input().split())\na = list(map(int,input().split()))\nb = set(a[1:])\nfor i in range(x-1):\n a = list(map(int,input().split()))\n b = b & set(a[1:])\nprint(len(b))\n\n'] | ['Runtime Error', 'Accepted'] | ['s797640741', 's994602739'] | [3064.0, 3060.0] | [18.0, 18.0] | [260, 179] |
p03126 | u455696302 | 2,000 | 1,048,576 | 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. | ['N,M = map(int,input().split())\nres = []\nfor i in range(N):\n res.append(list(map(int,input().split())))\n\nif N == 1:\n print(res[0][0])\n exit()\n\ns = [0 for i in range(M)]\nfor i in res:\n for j in i[1:]:\n s[j-1] += 1\n\ncount = 0\nfor i in range(N):\n if s[i] == N:\n count += 1', 'N,M = map(int,input().split())\nres = []\nfor i in range(N):\n res.append(list(map(int,input().split())))\n\nif N == 1:\n print(res[0][0])\n exit()\n\ns = [0 for i in range(M)]\nfor i in res:\n for j in i[1:]:\n #print(j)\n s[j-1] += 1\n\n#print(s)\n\ncount = 0\nfor i in range(M):\n if s[i] == N:\n count += 1\n\nprint(count)'] | ['Runtime Error', 'Accepted'] | ['s021514886', 's036946317'] | [3064.0, 3064.0] | [17.0, 17.0] | [297, 340] |
p03126 | u457683760 | 2,000 | 1,048,576 | 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. | ['n,m=[int(i) for i in input().split()]\nP=[[int(i) for i in input().split()] for j in range(n)]\n\nfor i in range(n):\n del P[i][0]\n \nK = set(P[0])\nL = {}\nfor i in range(1,n):\n L = set(P[i])\n K = K & L\nM = list(K)\nif len(M) == 0:\n print(0)\nelse:\n for i in range(len(M)):\n print(M[i])', 'n,m=[int(i) for i in input().split()]\nP=[[int(i) for i in input().split()] for j in range(n)]\n\nfor i in range(n):\n del P[i][0]\n \nK = set(P[0])\nL = {}\nfor i in range(1,n):\n L = set(P[i])\n K = K & L\nprint(len(K))'] | ['Wrong Answer', 'Accepted'] | ['s947260598', 's926881675'] | [3064.0, 3064.0] | [17.0, 18.0] | [303, 222] |
p03126 | u464032595 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\nK = [0]*N\nA = [[0]*M for i in range(N)]\nfor i in range(N):\n x = list(map(int, input().split()))\n K[i] = x[0]\n A[i] = x[1:]\nl = A[0]\nfor i in range(1, N):\n j = 0\n max_j = len(l)-1\n j = 0\n while(j != max_j+1):\n print(l, A[i])\n if l[j] not in A[i]:\n del l[j]\n max_j -= 1\n j -= 1\n j += 1\nprint(len(l))', 'N, M = map(int, input().split())\nK = [0]*N\nA = [[0]*M for i in range(N)]\nfor i in range(N):\n x = list(map(int, input().split()))\n K[i] = x[0]\n A[i] = x[1:]\nl = set(A[0])\nfor i in range(1, N):\n l &= set(A[i])\nprint(len(l))'] | ['Wrong Answer', 'Accepted'] | ['s678799407', 's852907667'] | [3188.0, 3064.0] | [23.0, 17.0] | [361, 225] |
p03126 | u464397170 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\n\nall_set = set.intersection(*map(set, (\n list(map(int, input().split()))[1:]\n for i in range(N)\n))\n\nprint(len(all_set))', 'N, M = map(int, input().split())\n \nall_set = set.intersection(*map(set, (\n list(map(int, input().split()))[1:]\n for i in range(N)\n)))\n \nprint(len(all_set))'] | ['Runtime Error', 'Accepted'] | ['s290197220', 's989323396'] | [2940.0, 3060.0] | [17.0, 17.0] | [154, 157] |
p03126 | u472492255 | 2,000 | 1,048,576 | 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. | ['import sys\n\nlines = sys.stdin.read().rstrip().split("\\n")\nn, m = [int(x) for x in lines[0].split(" ")]\n\nresult = set(lines[1].split(" ")[1:])\n\nif len(lines) == 2:\n print(len(result))\nelse:\n for x in range lines[2:]:\n result = result & set(x.split(" ")[1:])\n print(len(result))\n ', 'import sys\n \nlines = sys.stdin.read().rstrip().split("\\n")\nn, m = [int(x) for x in lines[0].split(" ")]\n \nresult = set(lines[1].split(" ")[1:])\n \nif len(lines) == 2:\n print(len(result))\nelse:\n for x in lines[2:]:\n result = result & set(x.split(" ")[1:])\n print(len(result))\n '] | ['Runtime Error', 'Accepted'] | ['s759347500', 's117749832'] | [2940.0, 3060.0] | [18.0, 18.0] | [285, 282] |
p03126 | u474270503 | 2,000 | 1,048,576 | 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. | ['N, M=map(int, input().split())\nKA=[list(map(int,input().split())) for _ in range(N)]\n\ntmp=[0]*(M+1)\nfor i in range(N):\n\tfor j in range(1,KA[i][0]):\n\t\ttmp[KA[i][j]]+=1\n# print(tmp)\nans=0\nfor i in range(M):\n\tif tmp[i]==N:\n\t\tans+=1\nprint(ans)', 'N, M=map(int, input().split())\nKA=[list(map(int,input().split())) for _ in range(N)]\n\ntmp=[0]*(M+1)\nfor i in range(N):\n\tfor j in range(1,KA[i][0]+1):\n\t\ttmp[KA[i][j]]+=1\nprint(tmp)\nans=0\nfor i in range(M):\n\tif tmp[i]==N:\n\t\tans+=1\nprint(ans)', 'N, M=map(int, input().split())\nKA=[list(map(int,input().split())) for _ in range(N)]\n\ntmp=[0]*(M+1)\nfor i in range(N):\n\tfor j in range(1,KA[i][0]+1):\n\t\ttmp[KA[i][j]]+=1\nprint(tmp)\nans=0\nfor i in range(M+1):\n\tif tmp[i]==N:\n\t\tans+=1\nprint(ans)', 'N, M=map(int, input().split())\nKA=[list(map(int,input().split())) for _ in range(N)]\n\ntmp=[0]*(M+1)\nfor i in range(N):\n\tfor j in range(1,KA[i][0]+1):\n\t\ttmp[KA[i][j]]+=1\n# print(tmp)\nans=0\nfor i in range(M+1):\n\tif tmp[i]==N:\n\t\tans+=1\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s007624085', 's961871536', 's987567108', 's031126301'] | [3064.0, 3064.0, 3064.0, 3064.0] | [18.0, 18.0, 19.0, 18.0] | [239, 239, 241, 243] |
p03126 | u474925961 | 2,000 | 1,048,576 | 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. | ["import sys\n\nif sys.platform =='ios':\n sys.stdin=open('input_file.txt')\n \nn,m=map(int,input().split())\n\nS=set(range(a,m+1))\nfor i in range(n):\n\tK,*A=map(int,input().split())\n\tS&=set(A)\nprint(len(S))", "import sys\n\nif sys.platform =='ios':\n sys.stdin=open('input_file.txt')\n \nn,m=map(int,input().split())\n\nS=set(range(1,m+1))\nfor i in range(n):\n\tK,*A=map(int,input().split())\n\tS&=set(A)\nprint(len(S))"] | ['Runtime Error', 'Accepted'] | ['s010874421', 's783447681'] | [3060.0, 3060.0] | [17.0, 18.0] | [203, 203] |
p03126 | u475329018 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\na = [0] * n\nfood = [0] * (m+1)\nfor i in range(n):\n a = list(map(int, input().split()))\n for j in a:\n food[j] += 1\n\nsum = 0\nfor i in range(m):\n if food[i] == n:\n sum += 1\n\nprint(sum)', 'n, m = map(int, input().split())\nfood = {}\nfor i in range(n):\n a = input().split()[1:]\n food = set(food)&set(a)\n if i == 0:\n food = a\n\nprint(len(food))'] | ['Wrong Answer', 'Accepted'] | ['s982618546', 's977198819'] | [3064.0, 3060.0] | [17.0, 17.0] | [237, 167] |
p03126 | u477650749 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\nli = []\nfor i in range(n):\n l = list(map(int, input().split()))\n for j in l[1:]:\n li.append(j)\nprint(li)\nans = 0\nfor i in range(31):\n if li.count(i) == n:\n ans += 1\nprint(ans)', 'n, m = map(int, input().split())\nli = []\nfor i in range(n):\n l = list(map(int, input().split()))\n for j in l[1:]:\n li.append(j)\nans = 0\nfor i in range(31):\n if li.count(i) == n:\n ans += 1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s267808473', 's514443041'] | [3060.0, 3060.0] | [18.0, 18.0] | [231, 221] |
p03126 | u478588435 | 2,000 | 1,048,576 | 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. | ['from collections import Counter\nctr = Counter()\nN, M = map(int,input().split())\nfor _ in range(N):\n ctr.update(list(map(int,input().split()))[1:])\nprint(len([None for v in ctr.values() if v == M]))', 'from collections import Counter\nctr = Counter()\nN, M = map(int,input().split())\nfor _ in range(N):\n ctr.update(map(int,input().split())[1:])\nprint(len([None for v in ctr.values() if v == M]))', 'from collections import Counter\nctr = Counter()\nN, M = map(int,input().split())\nfor _ in range(N):\n ctr.update(list(map(int,input().split()))[1:])\nprint(len([None for v in ctr.values() if v == N]))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s054972559', 's570266675', 's475864347'] | [3316.0, 3316.0, 3316.0] | [21.0, 21.0, 21.0] | [198, 192, 198] |
p03126 | u483896240 | 2,000 | 1,048,576 | 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. | ['# -*- coding: utf-8 -*-\n\nn,m = map(int,input().split() )\nb = [0]*m\nfor i in range(n):\n\ta = list(map(int, input().split()))\n\tfor j in range(1, len(a)):\n\t\tprint(j)\n\t\tb[a[j]-1] += 1\nans = b.count(n)\nprint(ans)\n\n', '# -*- coding: utf-8 -*-\n\nn,m = map(int,input().split() )\nb = [0]*m\nfor i in range(n):\n\ta = list(map(int, input().split()))\n\tfor j in range(1, len(a)):\n\t\tb[a[j]-1] += 1\nans = b.count(n)\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s832866416', 's774333140'] | [3060.0, 2940.0] | [19.0, 18.0] | [208, 197] |
p03126 | u488670118 | 2,000 | 1,048,576 | 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. | ['n, m = map(int, input().split())\nf = []\n\nfor i in range(n):\n f.append(list(map(int, input().split())))\n\nnum = [0 for i in range(m+1)]\n \nfor i in range(n):\n for j in range(1, len(f[i])):\n num[f[i][j]] += 1\n \n \ncnt = 0\nfor i in num:\n if i = n:\n cnt += 1\n \n \nprint(cnt)', 'n, m = map(int, input().split())\nf = []\n\nfor i in range(n):\n f.append(list(map(int, input().split())))\n\nnum = [0 for i in range(m+1)]\n \nfor i in range(n):\n for j in range(1, len(f[i])):\n num[f[i][j]] += 1\n \n \ncnt = 0\nfor i in num:\n if i == n:\n cnt += 1\n \n \nprint(cnt)'] | ['Runtime Error', 'Accepted'] | ['s060470943', 's213647994'] | [2940.0, 3064.0] | [17.0, 18.0] | [288, 289] |
p03126 | u496744988 | 2,000 | 1,048,576 | 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. | ['import sys\nn, m = map(int, input().split())\nlikes = [list(map(int, input().split())) for _ in range(n)]\nif n == 1:\n print(len(likes[0]) - 1)\n sys.exit(0)\ncommon = set(likes[0][1:]) & set(likes[1][1:])\nfor i in range(2, len(likes)):\n common = common & set(likes[i][1:])\nprint(common)\nprint(len(common))\n', 'import sys\nn, m = map(int, input().split())\nlikes = [list(map(int, input().split())) for _ in range(n)]\nif n == 1:\n print(len(likes[0]) - 1)\n sys.exit(0)\ncommon = set(likes[0][1:]) & set(likes[1][1:])\nfor i in range(2, len(likes)):\n common = common & set(likes[i][1:])\nprint(len(common))\n'] | ['Wrong Answer', 'Accepted'] | ['s788777119', 's533601257'] | [3064.0, 3064.0] | [17.0, 18.0] | [311, 297] |
p03126 | u497310132 | 2,000 | 1,048,576 | 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. | ['N, M = (int(x) for x in input().split())\nKA = [[int(x) for x in l] for l in [input().split() for i in range(N)]]\n[x.pop(0) for x in KA]\nx = []\nfor s in KA:\n x.extend(s)\nc = 0\nfor i in range(1, M + 1):\n print(x.count(i))\n c = c + (1 if x.count(i) == N else 0)\nprint(c)', 'N, M = (int(x) for x in input().split())\nKA = [[int(x) for x in l] for l in [input().split() for i in range(N)]]\n[x.pop(0) for x in KA]\n\nx = []\nfor s in KA:\n x.extend(s)\n#print(x)\nc = 0\nfor i in range(1, M + 1):\n #print(x.count(i))\n c = c + (1 if x.count(i) == N else 0)\nprint(c)'] | ['Wrong Answer', 'Accepted'] | ['s085783545', 's849635714'] | [3064.0, 3060.0] | [18.0, 18.0] | [270, 292] |
p03126 | u497883442 | 2,000 | 1,048,576 | 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. | ['n,m = list(map(int,input().split()))\nb = [0 for i in range(m)]\nfor i in range(n):\n ka = list(map(int,input().split()))\n k = ka[0]\n a = ka[1:]\n for j in range(k):\n b[a[j]-1] += 1\nc = 0\nfor i in range(n):\n if b[i] == 10:\n c += 1\nprint(c)', 'n,m = list(map(int,input().split()))\nb = [0 for i in range(m)]\nfor i in range(n):\n ka = list(map(int,input().split()))\n k = ka[0]\n a = ka[1:]\n for j in range(k):\n b[a[j]-1] += 1\nc = 0\nfor i in range(m):\n if b[i] == n:\n c += 1\nprint(c)\n'] | ['Runtime Error', 'Accepted'] | ['s787632606', 's156680230'] | [3060.0, 3060.0] | [18.0, 19.0] | [246, 246] |
p03126 | u513081876 | 2,000 | 1,048,576 | 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. | ['N, M = map(int, input().split())\ncheck = [0] * M\nfor i in range(N):\n a = [int(i - 1) for i in input().split()]\n a = a[1:]\n for j in check:\n check[j] += 1\n \n\nans = 0\nfor i in check:\n if i == N:\n ans += 1\nprint(ans)', 'N, M = map(int, input().split())\ncheck = [0] * M\nfor i in range(N):\n a = [int(i) - 1 for i in input().split()]\n a = a[1:]\n for j in a:\n check[j] += 1\n\n\nans = 0\nfor i in check:\n if i == N:\n ans += 1\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s385424113', 's419371415'] | [3064.0, 3060.0] | [17.0, 18.0] | [242, 234] |
p03126 | u518042385 | 2,000 | 1,048,576 | 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. | ['n,m=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(n)]\nc=0\nfor i in range(m):\n b=True\n for j in range(n):\n if i in l[j]:\n pass\n else:\n b=False\n if b:\n c+=1\nprint(c)\n \n', 'n,m=map(int,input().split())\nlist1=[]\nfor i in range(n):\n l=list(map(int,input().split()))\n del l[0]\n list1.append(l)\nc=0\nfor i in range(1,1+m):\n b=True\n for j in range(n):\n if i in list1[j]:\n pass\n else:\n b=False\n if b==True:\n c+=1\nprint(c)'] | ['Wrong Answer', 'Accepted'] | ['s209753373', 's402500845'] | [3060.0, 3060.0] | [19.0, 18.0] | [217, 266] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.