Problem:


Score : 200 points

Problem Statement

N Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.

There are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}}.

Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?

Constraints

All values in input are integers.

1 \leq N \leq 100

1 \leq K \leq 100

1 \leq d_i \leq N

1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N

Input

Input is given from Standard Input in the following format:

N K
d_1
A_{1, 1} \cdots A_{1, d_1}
\vdots
d_K
A_{K, 1} \cdots A_{K, d_K}

Output

Print the answer.

Sample Input 1

3 2
2
1 3
1
3

Sample Output 1

1

Snuke 1 has Snack 1.

Snuke 2 has no snacks.

Snuke 3 has Snack 1 and 2.

Thus, there will be one victim: Snuke 2.

Sample Input 2

3 3
1
3
1
3
1
3

Sample Output 2

2



Sample input:
3 2
2
1 3
1
3


Sample output:
1

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
d = [0]*K

C = [0]*N
for i in range(K):
    d[i]=int(input())
    A=list(map(int, input().split()))
    for j in range(N):
        for k in range(d[i]):
            if A[k]==j+1:
                C[j]=1
                break

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


print("{}".format(count))

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  str_N_K = input()
  
  list_N_K = str_N_K.split(' ')
  N = int(list_N_K[0])
  K = int(list_N_K[1])
  
  list_person = [0] * N
  
  for i in range(K):
    d = int(input())
    str_persons = input()
    if (" " in str_persons):
      list_str_persons = str_persons.split(" ")
    else:
      list_str_persons = [str_persons]
      
    for str_person in list_str_persons:
      int_person = int(str_person)
      list_person[int_person] += 1
  
  output = 0
  for person in list_person:
    if person == 0:
      output += 1
      
  print(output)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  str_N_K = input()
  
  list_N_K = str_N_K.split(' ')
  N = int(list_N_K[0])
  K = int(list_N_K[1])
  
  list_person = [0] * N
  
  for i in range(K):
    d = int(input())
    str_persons = input()
    if (" " in str_persons):
      list_str_persons = list_str_persons.split(" ")
    else:
      list_str_persons = list_str_persons
      
    for str_person in list_str_persons:
      int_person = int(str_person)
      list_person[int_person] += 1
  
  output = 0
  for person in list_person:
    if person == 0:
      output += 1
      
  print(output)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  str_N_K = input()
  
  list_N_K = str_N_K.split(' ')
  N = int(list_N_K[0])
  K = int(list_N_K[1])
  
  list_person = [0] * N
  
  for i in range(K):
    d = int(input())
    str_persons = input()
    if " " in str_persons:
      list_str_persons = list_str_persons.split(" ")
    else:
      list_str_persons = list_str_persons
      
    for str_person in list_str_persons:
      int_person = int(str_person)
      list_person[int_person] += 1
  
  output = 0
  for person in list_person:
    if person == 0:
      output += 1
      
  print(output)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  str_N_K = input()
  list_N_K = str_N_K.split(' ')
  N = int(list_N_K[0])
  K = int(list_N_K[1])
  
  list_person = [0] * N
  
  for i in range(K):
    d = int(input())
    str_persons = input()
    list_str_persons = str_persons.split(" ")
    for str_person in list_str_persons:
      int_person = int(str_person)
      list_person[int_person] += 1
  
  output = 0
  for person in list_person:
    if person == 0:
      output += 1
      
  print(output)

Submission status: Runtime Error

Solution code:
N,K=input()
d=input()
print(N-d)

Submission status: Runtime Error

Solution code:
N , K = int(input().split())

for i in range(1,K+1):
    d = int(input())
    A = list(map(int, input().split()))
    all1 = list()
    for j in range(d):
        all.append(A[j])


B = list(set(all1))

human = list(range(1 , N))


print(list(filter(lambda x:x not in B, human)))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
    input()
	a=list(map(int,input().split()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
	a=list(map(int,input().split()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
    input()
	a=list(map(int,input()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
ans = [i for i in range(1,n+1)]
for i in range(k):
	a=list(map(int,input()))
	for j in a:
      if j in ans:
        ans.remove(j)
print(len(ans))

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())

susuke = [1] * N

for i in range(K):
  di = int(input())
  ai = map(int, input().split())
  for j in range(ai):
    susuke[j - 1] = 0
    
print(sum(susuke))

Submission status: Runtime Error

Solution code:
input_list = []
while True:
  a = input()
  if a:
    input_list.append(a)
  else:
    break

box_ = input_list[0].split(' ')[0]
box = [i for i in range(1, int(box_)+1)]

s = set()
for j, k in enumerate(input_list):
  if j != 0 and j % 2 == 0:
    for l in k.split(' '):
      s.add(int(l))
      
ma = [i for i in box if i not in s]
print(len(ma))

Submission status: Runtime Error

Solution code:
input_list = []
while True:
    a = input()
    if a:
        input_list.append(a)
    else:
        break

box_ = input_list[0].split(' ')[0]
box = [i for i in range(1, int(box_)+1)]

s = set()
for j, k in enumerate(input_list):
    if j != 0 and j % 2 == 0:
        for l in k.split(' '):
            s.add(int(l))
      
ma = [i for i in box if i not in s]
print(len(ma))

Submission status: Runtime Error

Solution code:
# N人
# K種類のお菓子
# お菓子iを持っているのは、Ai,1 ~ Ai,diの計di人
# 奇数行のsetがNと被っていない個数を返す
input_list = []
while True:
  a = input()
  if a:
    input_list.append(a)
  else:
    break

box_ = input_list.split(' ')[0]
box = [i for i in range(1, int(box_)+1)]

s = set()
for j, k in enumerate(input_list):
  if j != 0 and j % 2 == 0:
    for l in k.split(' '):
      s.add(int(l))
      
ma = [i for i in box if i not in s]
print(len(ma))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
  d=int(input())
  s=input().split()
  for b in range(d):
    if int(s[b]) in x:
      x.remove(int(s_i[b]))
print(len(x))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
D = {}
for i in range(N):
    D[i+1] = 0
for i in range(K):
    d = input()
    A = list(map(int,input().split()))
    for a in A:
        d[a] += 1
ans = 0
for i in range(N):
    if D[i+1] == 0:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
A = []
for i in range(K):
  d = input()
  A += list(map(int, input()))
print(N - len(set(A)))

Submission status: Runtime Error

Solution code:
n, k = map(int, input())
total = []
for _ in range(k):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    total.append(a)
ans = n - len(set(total))
print(ans)

Submission status: Runtime Error

Solution code:
n, k = map(int, input())
total = set()
for _ in range(k):
  d = int(input())
  a = set(map(int, input().split()))
  for b in a:
    total.add(b)
ans = n - len(total)
print(ans)

Submission status: Runtime Error

Solution code:
n, k = map(int, input())
total = set()
for _ in range(k):
  d = int(input())
  a = set(map(int, input().split()))
  total = total | a
ans = n - len(total)
print(ans)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  lists.append(list)
num=[0]*n
for list in lists:
  for __ in range(len(list)):
    num[list[__]-1]+=1
count=0
for nn in num:
  if nn==0:
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  list.append(list)
num=[0]*n
for list in lists:
  for __ in range(len(list)):
    num[list[__]-1]+=1
count=0
for nn in num:
  if nn==0:
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())

lst = [0] * N

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

print(lst.count(0))

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
ans_li = [0 for x in range(a)]

for i in range(b):
  d = int(input())
  for j in range(d):
    l = list(map(int, input().split()))
    for ll in l:
      ans_li[ll-1] += 1
print(ans_li.count(0))

Submission status: Runtime Error

Solution code:
def main():
    ans = 0
    n,k = map(int, input(.split()))
    l = [0]*n
    for i in range(k):
        d = int(input())
        s = list(map(int, input().split()))
        for j in s:
            l[j-1] += 1
    for i in range(n):
        if l[i] == 0:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
d=[]
a=[]
for i in range(K):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
    
aa=[0]*N
counts=0

for k in K:
    for j in a[k]:
        aa[j-1]=1
        
for x in range(N+1):
    if aa[x-1]==0:
        counts+=1

print(counts)

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
d=[]
a=[]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
    
aa=[0]*N
counts=0

for k in K:
    for j in a[k]:
        aa[j-1]=1
        
for x in range(N+1):
    if aa[x-1]==0:
        counts+=1

print(counts)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input().split()
for i in range(int(K)):
    whatMan.extend(input().split())
print(int(N) - set(whatMan).count)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input().split()
for i in range(int(K)):
    whatMan.extend(input().split())
print(int(N) - set(wahtMan).count)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input().split()
wahtMan.extend(input().split())
print(wahtMan)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input().split()
for i in range(int(K)):
    wahtMan.extend(input().split())
print(wahtMan)

Submission status: Runtime Error

Solution code:
whatMan = []
 
N, K = input().split()
for i in range(int(K)):
    wahtMan.append(input().split())
print(wahtMan)

Submission status: Runtime Error

Solution code:
whatMan = []
 
N, K = input()
for i in range(int(K)):
    wahtMan.append(input().split())
print(wahtMan)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input().split()
for i in range(int(K)):
    wahtMan.append(input().split())
print(wahtMan)

Submission status: Runtime Error

Solution code:
whatMan = []
 
N, K = input()
for i in range(int(K)):
　　　　wahtMan.append(input().split())
print(wahtMan)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input()
for i in range(int(K)):
    wahtMan.append(input().split())

print(int(N) - set(wahtMan).count)

Submission status: Runtime Error

Solution code:
whatMan = []

N, K = input()
for i in range(1, K):
    wahtMan.append(input().split())
print(N - set(wahtMan).count)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
tmp_A = [0]*N
ans = 0

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
const int NMAX = 1001;
int vis[NMAX];
int main(int argc, char const *argv[])
{
	int n,k,d;
	scanf("%d%d",&n,&k);
	while(k--)
	{
		scanf("%d",&d);
		while(d--)
		{
			int p;
			scanf("%d",&p);
			vis[p]++;
		}
	}
	int ans = 0;
	for(register int i = 1;i <= n;i++)
		ans += vis[i] == 0;
	printf("%d\n",ans );
	return 0;
}

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())

d = int(input())

num = [int(input()) for _ in range(n)]

print(n - d)

Submission status: Runtime Error

Solution code:
N,K=map(int,input())
B=[]
for i in range(K):
  D=int(input())
  A=list(map(int,input().split()))
  for j in A:
    B.append(j)
print(N-len(set(B)))

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
L = []
for i in range(N):
  d = int(input())
  if d == 1:
    A = list(int(input()))
  else:
    A = list(map(int, input().split()))
  for j in range(d):
    L.append(A[j])
print(N-len(set(L)))

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
L = []
for i in range(N):
  d = int(input())
  if d == 1:
    A = int(input())
  else:
    A = list(map(int, input().split()))
  for j in range(d):
    L.append(A[j])
print(N-len(set(L)))

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
L = []
for i in range(N):
  d = int(input())
  A = list(map(int, input().split()))
  for j in range(d):
    L.append(A[j])
print(N-len(set(L)))

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
L = []
for i in range(N):
  d = int(input)
  A = list(map(int, input().split()))
  for j in range(d):
    L.append(A[j])
print(N-len(set(L)))

Submission status: Runtime Error

Solution code:
n,k = map(int , input().split())
a = []
from collections import defaultdict as dd
dc = dd(lambda : 0)
for i in range(k):
  d = int(input())
  a = list(map(int , input().split()))
  for i in a:
    dc[i] += 1
cnt = 0
for i in range(1 , n + 1):
  if d[i] == 0:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
snukes = [0] * n
for _ in range(k):
  d = int(input())
  a = map(int, input().split())
  for i in a:
    snukes[i] += 1

print(snukes.count(0))

Submission status: Runtime Error

Solution code:

N, K = map(int, input().split())
A = [0] * N

for i in range(K):
    d = int(input())
    targets = list(map(int, input().split()))
    for j in range(d):
        index = targets[j-1]
        A[index] = 1

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

print(count)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
L = [1 for i in range(N)]
for k in range(K):
  d = int(input())
  A = list(map(int, input().spit()))
  for i in range(d):
    L[A[i] - 1] = 0
print(sum(L))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split(" "))
s = set()
for i in range(K-1):
	d = int(input())
	for j in range(d):
		inp = input()
		l = []
		if len(inp) > 1:
			l = map(int,inp.split(" "))
		else:
			l.append(int(inp))
		for e in l:
			s.add(e)
print(N - len(s))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split(" "))
s = set()
for i in range(K-1):
	d = int(input())
	for j in range(d):
		l = map(int,input().split(" "))
		for e in l:
			s.add(e)
print(N - len(s))

Submission status: Runtime Error

Solution code:
N,K=input().strip().split(" ")
N=int(N)
K=int(K)
checkbox=[False for i in range(N)]
for k in range(K):
  input()
  seq=input().strip().split(" ")
  for j in seq:
    checkbox[i]=True
print(checkbox.count(False))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split(" "))
s = set()
for i in range(K):
	d = int(input())
	for j in range(d):
		l = map(int,input().split(" "))
		for e in l:
			s.add(e)
print(N - len(s))

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split)
z=list()
for i range(K):
  a=input()
  l=list(map(int,input.split()))
  for b in range(l):
    if b not in l:
      z.append(b)
print(N-len(z))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
ans = []
for _ in range(k):
    d = list(int(input()))
    a = list(map(int, input().split()))
    ans += a
print(n-len(set(ans)))

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
ans = [1]*N

for i in range(0,K):
  d = int(input())
  table  = list(map(int, input().split()))
  for j in range(0,N):
    if table.count(j) == 0:
      ans[j] = 0
print(1-sum(ans))

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split)
z=list()
for i range(K):
  a=input()
  l=list(map(int,input.split()))
  if b not in l:
    z.append(b)
print(N-len(z))

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
ans = [1]*N

for i in range(0,K):
  d = int(input())
  table  = list(map(int, input().split()))
  for j in range(0,N):
    if table.count(j) != 0:
      ans[j] = 0
print(sum(ans))

Submission status: Runtime Error

Solution code:
N = input()
K = input()
ans = [1]*N

for i in range(0,K):
  d = int(input())
  table  = list(map(int, input().split()))
  for j in range(0,N):
    if table.count(j) != 0:
      ans[j] = 0
print(sum(ans))

Submission status: Runtime Error

Solution code:
N, K = [int(ipt) for ipt in input().split(' ')]

sunukekuns = [str(i) for i in range(N)]

for k in range(K):
  _ = input()
  sunukekun = input().split(' ')
  for (kun in sunukekun):
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))

Submission status: Runtime Error

Solution code:
N, K = input().split(' ')

sunukekuns = [i for i in range(N)]

for k in range(K):
  _, sunukekun = input(), input().split(' ')
  for (kun in sunukekun):
    if kun in sunukekuns:
      sunukekuns.remove(kun)

print(len(sunukekuns))

Submission status: Runtime Error

Solution code:
n,k = list(map(int,input().strip().split()))
temp = []
ans = int(0)
for i in range(k+1):
    d = int(input())
    li = list(map(int,input().split()))
    for j in range(d):
        temp += str(li[j])
for m in range(n+1):
    b  = str(m + 1)
    a = temp.count(b)
    if a == 0:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
s = []
n, k = map(int, input().split())
for i in range(n):
	s.append(0)
for i in range(k):
	m = int(input())
    na = list(map(int, input().split())
    for j in na:
    	s[j - 1] = 1
         
print(s.count(0))

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
lis = [0]*b
for i in range(a):
  c = int(input())
  d = input().split()
  
  for l in range(c):
    lis[int(d[l])-1] += 1
    
count = 0
for i in range(b):
  if(lis[i] == 0):
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
N, K =map(int, input().split())
snuke = [0]*N

for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        snuke[a[j]] = 1

print(snuke.count(0))

Submission status: Runtime Error

Solution code:
s = []
n, k = map(int, input().split())
for i in range(n):
  s.append(0)
for i in range(k):
	m = int(input())
    na = list(map(int, input().split())
    for j in na:
    	s[j - 1] = 1
         
print(s.count(0))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
check = N*[0]

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

print(check.count(0))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
e=[]
for i in range(k):
  j=int(input())
  a=list(map(int,input().split()))
  e.extend(a)
e=list(set(e))
e.sort()

kon=list(range(1,n+1))

for i in range(0,len(e)):
  kon.remove(e[i])

print(kon[0])

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
check = N*[0]

for i in range(N):
	d = int(input())
	a = map(int,input().split())
	for i in a:
		check[i-1] = 1

print(check.count(0))

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
s=[]
for i in range(k):
  s= int(input())
  l=list(map(int,input().split()))
  s=s+l
r=set(s)
print(n-len(r))

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())

has_snack = set()
for i in range(K):
    d = int(input())
    A = set(map(int, input().split()))
    has_snack += A

print(N-len(has_snack))

Submission status: Runtime Error

Solution code:
import Foundation
 
let nk = readLine()!.split(separator:" ").map{Int($0)!}
var sets: Set<Int> = []
for _ in 1...nk[1]{
  let c = readLine()!
  let A = readLine()!.split(separator:" ").map{Int($0)!}
  for i in A{
  sets.insert(i)
  }
}
print(nk[0] - sets.count)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split()) #n任 k種類
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))


sunuke =[0] * n
for i in range(n-1):
    #print("d[i]",d[i])
    for j in range(int(d[i])):
        temp = a[i][j] -1 
        sunuke[temp] += 1

print(sunuke.count(0))

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
AA=set([])
for i in range(n):
  d=int(input())
  A=list(map(int,input().split()))
  AA=AA|set(A)#|は「パイプ」和集合
print(n-len(AA))

Submission status: Runtime Error

Solution code:
L = []

while True:
    l = list(map(int, input().split()))
    if l:
        L.append(l)
    else:
        break

print(L)

N = L[0][0]
K = L[0][1]

Num = list(range(1, N + 1, 1))

new_L = L[2::2]

new_LL = sum(new_L, [])
for n in new_LL:
    if n in Num:
        Num.remove(n)

print(len(Num))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
N_list = list()

for i in range(1,N+1):
	N_list.append(i)

for i in range(K):
	d = int(input())
	a_list = map(int,input().split())
	for n in N_list:
		for a in a_list:
			if n == a:
				N_list.remove(n)

print(N_list[0])

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=[0,0,0]

for i in range(k):
  d=int(input())
 
  List=list(map(int,input().split()))
  for i in range(d):
    s[List[i]-1]=1
print(n-sum(s))

Submission status: Runtime Error

Solution code:
#coding: utf-8
from math import ceil, floor
X = int(input())
a = 0
a2 = -a
def sign(v):
    if v < 0:
        return -1
    else:
        return 1
def counter(a):
    v = abs(a)
    for i in range(1, int(v**0.5)+2):
        if v % i == 0:
            if v == i**5:
                return True
    return False
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if counter(b):
        if a**5 - b == X:
            print(a, int(abs(round(b))**(1/5))*sign(b))
            quit()
    if counter(b2):
        if a2 ** 5 - b2 == X:
            print(a2, int(abs(round(b))**(1/5))*sign(b2))
            quit()
    a += 1

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
s=[0,0,0]

for i in range(k):
  d=int(input())
 
  List=list(map(int,input().split()))
  for i in range(d):
    s[List[i]-1]=1
print(n-sum(s))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(2000)

n,k = map(int,input().split())
lisN = list(range(1,n+1))
lis = set([])

for i in range(k):
    a =int(input())
    for j in range(a):
        lis.add(int(input()))
        

    
print(len(set(lisN) ^ set(lis)))

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
d = []
A = []

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

okashi = [0] * N

for l in range(N):
    for i in A[l]:
        okashi[i-1] += 1

count = 0
for i in okashi:
    if i == 0:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
import numpy as np
N, K = map(int, input().split())
 
A = np.zeros(N, dtype=int)

Submission status: Runtime Error

Solution code:

N,K = input().split()
N = int(N)
K = int(K)
N_list = list()

for i in range(1,N+1):
	N_list.append(i)

for i in range(K):
	d = int(input())
	a_list = input().split()
	
	for i in N_list:
		for j in a_list:
			if i == int(j):
				N_list.remove(i)
answer = N_list[0]

print(answer)

Submission status: Runtime Error

Solution code:
L = []
while True:
    l = list(map(int, input().split()))
    if l:
        L.append(l)
    else:
        break

N = L[0][0]
K = L[0][1]

Num = list(range(1,N+1,1))

new_L = L[2::2]

new_LL = sum(new_L,[])
for n in new_LL:
    if n in Num:
        Num.remove(n)

print(len(Num))

Submission status: Runtime Error

Solution code:
import itertools
N, K = list(map(int, input().split()))
d = []
A = [[0]]*N
for i in range(K):
    d.append(int(input()))
    A[i] = list(map(int, input().split()))
 
s = list(set((list(itertools.chain.from_iterable(A)))))

for i in range(len(s)):
    if s[i] == 0:
        s.remove(0)
        break

print(N-len(s))

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
d1=int(input())
S = [list(map(int,input().split())) for i in range(d1)]
count=0
for i in range(N):
    if i not in (S):
        count+=1
    i+=1
print(count)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May  3 21:46:59 2020

@author: nanasakiwataru
"""


N, K = map(int,input().split()) 
P = [list(map(int,input().split())) for i in range(K)]
#
#P = [0]*4
#P[0]=[2]
#P[1]=[1, 3]
#P[2]=[1]
#P[3]=[3]

#N = 3
#K = 2
Q = [0]*N
for i in range(1,K,1):
    for j in range(len(P[i-1])):
      Q[P[i][j]-1] += 1

cnt = 0
for k in range(N):
    if Q[k] == 0:
        cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
import itertools
n, k = map(int, input().split())
a = []
n= map(str, list(range(1,n+1)))
for num in range(k):
    d = int(input())
    a.append(list(input()))
list1 = list(set(list(itertools.chain.from_iterable(a))))
list1.remove(' ')
list1.sort()
result =list(set(n)-set(list1))
print(len(result))

Submission status: Runtime Error

Solution code:
s, n = map(int, input().split())
a = int(input())
c=[]
b = [int(input()) for i in range(n)]
c.append(b[i])
print(len(c))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
l = []*N
for i in range(N):
    l.insert(i,0)
for i in range(K):
    d = int(input())
    A = []*d
    A = input().split()
    l.insert(int(A[0]), i)
    l.insert(int(A[1]), i)

for i in l:
    if i == 0:
        j = j + 1
print(j)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())

sunuke = [[0] * (n+2)] * (k+2)
ans = 0
for j in range(1, k+1) :
    num_have_okashi = int(input())
    oakshi_sunuke = list(map(int,input().split()))

    for i in oakshi_sunuke :
        sunuke[i][j] = 1
        print('num_have_okashi = [%d]' % (num_have_okashi))
        print(oakshi_sunuke)
        print('sunuke[%d][%d] = %d' % (i, j, sunuke[i][j]))
        ans = ans + 1
        break

print(n-ans)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
lisN = list(range(1,n+1))
lis = set([])

for i in range(k):
    a =int(input())
    for j in range(a):
        lis.add(int(input()))
        

    
print(len(set(lisN) ^ set(lis)))

Submission status: Runtime Error

Solution code:
import random

def sunuke():
  n = int(input())
  k = int(input())
  n_list = range(n)

  if 1 <= n <= 100 == False or 1 <= k <= 100 == False:
    print("すぬけくん、お菓子の種類は100以下で入力して下さい")
  else:
    treat = 0
    treat_list = {}
    for sunuke in n_list:
      treat_list.setdefault(sunuke, random.randint(0, n))
    
    for x in treat_list.values():
      if x == 0:
        treat += 1

    print(treat)

sunuke()

Submission status: Runtime Error

Solution code:
a,b,c,d,e,f,g=(int(x) for x in input().split())
print(a-c)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
sunuke_dic = {}
for i in range(N):
    sunuke_dic[i+1] = 0

for i in range(K):
    n = input()
    okasi_get = input()
    for j in okasi_get:
        if j == ' ':
            continue
        else:
            sunuke_dic[int(j)] += 1

itazura = list(sunuke_dic.values()).count(0)
print(itazura)

Submission status: Runtime Error

Solution code:
import random
n = list(range(1, int(input())))
k = int(input())
i = 0
m = 0

while i == k:
  for d in random.randint(1, k+1):
    for m in range(d)
      print(random.choice(n))
  i += 1

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
l = []*N
for i in range(N):
    l.insert(i,None)
for i in range(K):
    d = int(input())
    A = []*d
    A = input().split()
    l.insert(int(A[0]), i)
    l.insert(int(A[1]), i)

print(sum(x is not None for x in l))

Submission status: Runtime Error

Solution code:
import random

def sunuke():
  n = int(input())
  k = int(input())
  n_list = range(n)

  if 1 <= n <= 100 == False or 1 <= k <= 100 == False:
    print("すぬけくん、お菓子の種類は100以下で入力して下さい")
  else:
    treat = 0
    treat_list = {}
    for sunuke in n_list:
      treat_list.setdefault(sunuke, random.randint(0, k))
    
    for x in treat_list.values():
      if x == 0:
        treat += 1

    print(treat)

sunuke()

Submission status: Runtime Error

Solution code:

N,K = input().split()
N = int(N)
K = int(K)
N_list = list()

for i in range(1,N+1):
	N_list.append(i)

for i in range(K):
	d = int(input())
	a_list = input().split()
	N_list += a_list
	N_list = map(N_list)

print(N_list)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
c = 0
n = 1
for i in range(K):
  List = list(map(int, input().split()))
for I in range(N):
  if n in List:
  else:
    c = c+1
  n = n+1
print(c)

Submission status: Runtime Error

Solution code:
n, k =map(int, input().split())
d = int(input())

sunuke_list = []

count=0


for a in range(0,d):
    point = input()
    if not point in sunuke_list:
        sunuke_list.append(int(point))

for j in range(0,d):

    if j in sunuke_list:
        count +=1



if count<d:
    print(n-d)

else:
    print(n-count)

Submission status: Runtime Error

Solution code:
N, K= map(int, input().split())
d=[]*N
a=[]*N
while True:
    d.append(int(input()))
    a.append(list(map(int,input().split())))
    if N==sum(d):
        print(N-len(set(sum(a,[]))))
        break

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
ans_li = [0 for x in range(a)]

for i in range(b):
  d = int(input())
  for j in range(d):
    l = list(map(int, input().split()))
    for ll in l:
      ans_li[ll] += 1
print(ans_li.count(0))

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())

Sanuke=list(range(K))

def calc_double(n):
	return n - 1
def calc_zero(n):
	return n *0

Sanuke=map(calc_zero, Sanuke)
  
for i in range(N):
  di=int(input())
  A=list(map(int,input().split()))
  A=map(calc_double, A)
  for j in A:
    Sanuke[j]+=1

higaisha=0

for i in Sanuke:
  if i ==0:
    higaisha += 1

print(higaisha)

Submission status: Runtime Error

Solution code:
import random

def sunuke():
  n = int(input('すぬけくんの人数は??(1-100で入力) :'))
  k = int(input('お菓子の種類は??(1-100で入力) :'))
  n_list = range(n)

  if 1 <= n <= 100 == False or 1 <= k <= 100 == False:
    print("すぬけくん、お菓子の種類は100以下で入力して下さい")
  else:
    treat = 0
    treat_list = {}
    for sunuke in n_list:
      treat_list.setdefault(sunuke, random.randint(0, k))
    
    for x in treat_list.values():
      if x == 0:
        treat += 1

    print(treat)

sunuke()