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: Wrong Answer

Solution code:
#ABC166
n,k=map(int,input().split())
cnt=[0]*(n+1)
for j in range(k):
  tmp = int(input())
  arr=list(map(int,input().split()))
  for val in arr:
    cnt[val]+=1
ans=0
for i in range(1,n+1):
  if cnt[i]==0:
    ans+=1
print('Anser is ' + str(ans))

Submission status: Wrong Answer

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

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        s[a[0]] += 1

cnt = 0        
for k in range(1,n+1):
    if s[k] == 0:
        cnt += 1
        
print(cnt)

Submission status: Wrong Answer

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

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        s[a[0]] += 1
        
s[0] += 1
print(s.count(0))

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
ans=[1]*n
for _ in range(k):
    d=int(input())
    li=list(map(int,input().split()))
    for i in li:
        ans[i-1]==0
print(sum(ans))

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
snuke = []
for _ in range(k):
    okashi = int(input())
    snuke += [int(v) for v in input().split()]
target = 1
for j in range(len(snuke)):
    if j + 1 != target:
        print(j + 1)
        break

Submission status: Wrong Answer

Solution code:
import itertools
n,k = map(int,input().split())
ans = 0
l = []
for i in range(k) :
    d = int(input())
    l.append(input().split())

l = list(itertools.chain.from_iterable(l))
l = [int(i) for i in l]

for i in range(k) :
    if not i in l :
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(k):
    ans=[]
    d=int(input())
    li=list(map(int,input().split()))
    for j in range(1,n+1):
        if  (j not in li) and (j not in ans):
            ans.append(j)
print(len(ans))

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
A=[]
people=list(range(1,N+1,1))
for idx in range(K):
    d=int(input())
    X=list((map(int,input().split())))
    for i in range(len(X)):
        A.append(X[i])
print(A)
print(people)
ans =[i for i in people if not i in A]
print(len(ans))

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
d = int(input())
l = list(map(int, input().split()))
print(n-d)

Submission status: Wrong Answer

Solution code:
# coding=utf-8

if __name__ == '__main__':
    N, K = map(int, input().split())

    sunuke = [0] * N
    print(sunuke)

    for i in range(K):
        D = int(input())
        li = list(map(int, input().split()))

        for j in range(D):
            sunuke[li[j] - 1] += 1
            #print(sunuke)

    print(sunuke.count(0))

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
d = [0 for _ in range(K)]
A = [[] for _ in range(K)]
for i in range(K):
    d[i] = int(input())
    A[i] = list(map(int,input().split()))
su_list = [i for i in range(1,K+1)]
for i in range(K):
    for j in range(d[i]):
        if A[i][j]-1 in su_list:
            su_list.remove(A[i][j]-1)        
print(len(su_list))

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
d = [0 for _ in range(K)]
A = [[] for _ in range(K)]
for i in range(K):
    d[i] = int(input())
    A[i] = list(map(int,input().split()))
su_list = [i for i in range(1,K+1)]
for i in range(K):
    for j in range(d[i]):
        if A[i][j] in su_list:
            su_list.remove(A[i][j])        
print(len(su_list))

Submission status: Wrong Answer

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

for _ in range(K):
    d = int(input())
    A = map(int, input().split())
    for i in range(d):
        S[i] = True

print(sum(1 for x in S if not x))

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
sunuke_set = set(i for i in range(1, n))

for i in range(k):
    d = int(input())
    sunuke_list = list(map(int, input().split()))
    for sunuke in sunuke_list:
        sunuke_set.discard(sunuke)

print(len(sunuke_set))

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
d = []
A = []
for _ in range(K):
  d.append(int(input()))
  A.append(list(map(int, input().split())))

l = [1]*N
for i in range(K):
  for j in range(d[i]):
    print(i, j)
    print(A[i][j])
    l[A[i][j]-1] = 0
    
print(sum(l))

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
L=[list(map(int, input().split())) for i in range(2*k)]
Z=[]
for i in range(1,2*k,2):
  Z.extend(L[i])
x=0
for i in range(1,n):
  if Z.count(i)==0:
    x+=1
  else:
    pass
print(x)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
S = [i for i in range(1, K+1)]
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in A:
        if j in S:
            S.remove(j)
print(len(S))

Submission status: Wrong Answer

Solution code:
N,K = list(map(int, input('').split(' ')))
D = set()
for i in range(K):
  input('')
  D |= set(map(int, input('').split(' ')))
print(K-len(D))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

count = 0
for i in range(1,N +1,1):
	if okasi[i] != 1:
		count = count + 1
print(count)

Submission status: Wrong Answer

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

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

count = 0
for i in range(1,N +1,1):
	if okasi != 1:
		count = count + 1
print(count)

Submission status: Wrong Answer

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

for _ in range(k):
    d = int(input())
    a = list(map(int,input().split()))

    for e in a:
        t[e-1] += 1
ans = 0
l = [i for i in t if i != 0]
print(len(l))

Submission status: Wrong Answer

Solution code:
n,k=list(map(int, input("").split()))
d=[]
a=[]
t=[]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int, input("").split())))
for i in range(n):
    t.append(True)
for i in range(k):
    for j in range(d[i]):
        if t[j-1]:
            t[j-1]=False
out=0
for i in t:
    if i:
        out+=1
print(out)

Submission status: Wrong Answer

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

for i in range(N):
    if i+1 not in li:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
d = []
a = ''
for _ in range(k):
    d.append(int(input()))
    a += input()

ans = 0
for i in range(1, n + 1):
    if a.count(str(i)) == 0:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def Qb():
    n, k = map(int, input().split())
    ans = set()
    for v in range(k):
        d = int(input())
        ns = [int(v) for v in input().split()]
        for n in ns:
            ans.add(n)
    print(n - len(ans))


if __name__ == '__main__':
    Qb()

Submission status: Wrong Answer

Solution code:
def Qb():
    n, k = map(int, input().split())
    ans = set()
    for v in range(k):
        d = int(input())
        ans.add(tuple(int(v) for v in input().split()))
    print(n - len(ans))


if __name__ == '__main__':
    Qb()

Submission status: Wrong Answer

Solution code:
def Qb():
    n, k = map(int, input().split())
    ans = set()
    for v in range(k):
        d = int(input())
        ans.add(tuple(int(v) for v in input().split()))
        print(f'{d=}')
        print(f'{ans=}')
    print(n - len(ans))


if __name__ == '__main__':
    Qb()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
def main():
    n, k = map(int, input().split())
    
    for i in range(k):
        d = int(input())
        a_set = set(map(int, input().split()))
        if i == 0:
            ans = a_set
        else:
            ans.union(a_set)
    ans = len(set(range(1, n+1)) - ans)
    print(ans)
    
main()

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
lists = [input() for _ in range(k * 2)]

suspects = set(map(str, set(range(n))))
has_snack = set()
for i, v in enumerate(lists):
    if i % 2 == 1:
        continue
    for j in v.split():
        has_snack.add(j)
obake = suspects - has_snack

print(len(obake))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
list1 ={i for i in range(1,N)}
list2 = set()
for i in range(K):
  NN = int(input())
  MM = map(int,input().split())
  for j in MM:
    list2.add(j)

ans = list1 -list2
print(len(ans))

Submission status: Wrong Answer

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

D=[]
A=[]
C=[]
for i in range(k):
    D.append(int(input()))
    A.append(list(map(int,input().split())))
for i in range(1,n+1):
    C.append(int(i))

for i in range(k-1):
    for a in A[i]:
        if C.count(a)!=0:
            C.remove(a)
        
print( len(C) )

Submission status: Wrong Answer

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

D=[]
A=[]
C=[]
for i in range(k):
    D.append(int(input()))
    A.append(list(map(int,input().split())))
for i in range(1,n+1):
    C.append(int(i))

for i in range(k-1):
    for a in A[i]:
        if C.count(a)!=0:
            C.remove(a)
        
print( C, len(C) )

Submission status: Wrong Answer

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

D=[]
A=[]
C=[]
for i in range(k):
    D.append(int(input()))
    A.append(list(map(int,input().split())))
for i in range(1,n):
    C.append(int(i))

for i in range(k-1):
    for a in A[i]:
        if C.count(a)!=0:
            C.remove(a)
        
print( len(C) )

Submission status: Wrong Answer

Solution code:
n, k = map(int,input().split())
d = []
a = []
for i in range(1,k+1):
    d.append(int(input()))
    a_temp = list(map(int,input().split()))
    a.append(a_temp)

num = []
    
for i in range(n):
    cnt = 0
    for j in range(k):
        if i in a[j]:
            cnt += 1
    if cnt == 0:
        num.append(i)
print(len(num))

Submission status: Wrong Answer

Solution code:
import numpy as np

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

d = []
a = []

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

a = np.array(a)
a = np.unique(a)

print(N - len(a))

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
a = [0]*n
for _ in range(k):
    kind = int(input())
    for i in list(map(int,input().split())):
        a[i-1] += 1
print(a.count(0) if 0 not in a else 0)

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))

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

temp = [0] * n
for i in range(k):
    d = int(input())
    l = list(map(int, input().split()))
    for j in range(d):
        temp[j-1] += 1


ans = 0
for i in temp:
    if (i == 0):
        ans += 1

print (ans)

Submission status: Wrong Answer

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

count = [0]*(n+1)
count1 = 0

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

for i in range(n):
  if count[i] == 0:
    count1 += 1
print(count)
print(count1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
M=[]
i=0
for a in range(K*2):
   
    M= list(map(int, input().split()))
for b in range(1,N+1):
    if b not in M:
        i+=1
print(i)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(input())
 
print(N - len(tmp) + 1)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(input())
 
print(N - len(tmp) + 1)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(input())
 
print(N - len(tmp) - 1)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in map(int, input().split()):
    tmp[j-1] |= 1 
print(sum(tmp))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N , K = map(int, input().split())
has = set()
for _ in range(K):
    d = int(input())
    has = set(map(int, input().split()))
print(N - len(has))

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
s = ''
for i in range(n):
    s += str(i+1)
for i in range(k):
    input()
    ts = input().split(' ')
    for t in ts:
        s = s.replace(t, '')
print(len(s))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

s = [0 for i in range(int(105))]
n, k = map(int, input().split())
for i in range(k):
    d, a = int(input()), list(map(int, input().split()))
    for a_i in a: s[a_i] += 1
print(s[:n].count(0)-1)

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
 
D=[0]*N
 
for i in range(K):
    r = int(input())
    d = list(map(int,input().split()))
    for j in range(r):
        D[d[j]-1] = 1
 
 
cnt = 0
for i in range(N):
    if D[i] == 0:
        cnt += 1

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
A = set()
for _ in range(K):
  d = int(input())
  A.add(tuple(input().split()))
print(N - len(A))

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
table = [[int(i) for i in input().split()] for _ in range(K * 2)]

ans_list = []
sunuke_set = set(list(range(1, K + 1)))

for i in range(1, K * 2 + 1, 2):
    ans_list += table[i]

ans_set = set(ans_list)

print(len(sunuke_set - ans_set))

Submission status: Wrong Answer

Solution code:
N, K = map(int,input().split())
S = set() #Sがお菓子を持っている人
P = list(range(1,N+1,1))
for i in range(K):
  D = int(input())
  A = list(map(int, input().split()))
  for a in A:
    S.add(a)
print(set(P) - S)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
list_a=[]
for d in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  list_a.extend(a)
ans=0
for i in range(1,n): 
 if list_a.count(i)==0:
      ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
list_a=[]
for d in range(k-1):
  d=int(input())
  a=list(map(int,input().split()))
  list_a.extend(a)
ans=0
for i in range(1,n): 
 if list_a.count(i)==0:
      ans+=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

memo = {}
for i in range(n):
  memo[i] = 0

for i in range(k):
  d = int(input())
  a = [int(num) for num in input().split()]
  for j in range(d):
    if j in memo:
      memo[j] += 1
      
answer = []
for i in range(n):
  if memo[i] == 0:
    answer.append(str(i+1))
  
print(len(answer))

Submission status: Wrong Answer

Solution code:
import collections

n,k = map(int,input().split())
for i in range (k):
  d = int(input())
  a = map(int,input().split())
c = collections.Counter(a)
print(n-len(c))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = list(map(int, input().split()))
    ans = [0] * N
    for i in range(K-1):
        d = int(input())
        A = list(map(int, input().split()))
        for j in A:
            ans[j-1] += 1

    a = 0
    for i in ans:
        if i==0:
            a += 1
    print(a)
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# 166 B

n, k = map(int, input().split())
l = []
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    l = l + a

print(n-len(set(a)))

Submission status: Wrong Answer

Solution code:
# 166 B

n, k = map(int, input().split())
l = []
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    l.extend(a)

print(n - (len(set(a))))

Submission status: Wrong Answer

Solution code:
# 166 B

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

print(n - (len(set(a))))

Submission status: Wrong Answer

Solution code:
# 166 B

n, k = map(int, input().split())
dic = {}

for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    dic[d] = a

num = 0
for i in range(n):
    try:
        v = dic[i]
    except KeyError:
        num += 1 

print(num)

Submission status: Wrong Answer

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

L = []

for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  print(A)
  for _ in A:
    if not _ in L:
      L.append(_)
ans = N - len(L)
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
kouho = set(range(1, n))
for kashi in range(1, k):
  a = input()
  lst = map(int, input().split())
  for b in lst:
    kouho.discard(b)
print(len(kouho))

Submission status: Wrong Answer

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

print(total)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
a = [x*0 for x in range(n)]
count = 0

for i in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        a[A[j]-1] += 1
    print(a)
    
for t in range(n):
    if a[t] == 0:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
kids = list()
for i in range(k):
    d = input()
    kids += list(map(int, input().split()))
res = 0
print(kids)
for i in range(1,n+1):
    if i not in kids:
        res+= 1
print(res)

Submission status: Wrong Answer

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

d = []
a = []

for _ in range(k):
  d.append(int(input()))
  a.append(list(map(int,input().split())))
  
ans = [1] * n
for i in range(k):
  for ai in range(d[i]):
    if ans[ai] == 1:
      ans[ai] = 0
      
      
print(sum(ans))

Submission status: Wrong Answer

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

a_list = []
for i in range(k):
    for j in range(d[i]):
        a_list.append(a[i][j])


n_set = {i for i in range(1, n)}

a_set = set(a_list)

difference = n_set - a_set

print(len(difference))

Submission status: Wrong Answer

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

n_set = {i for i in range(1, n)}

a_set = set(a)

difference = n_set - a_set

print(len(difference))

Submission status: Wrong Answer

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

n_set = {i for i in range(1, n)}

a_set = set(a)

difference = n_set - a_set

print(len(difference))

Submission status: Wrong Answer

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

count=[0]*(n+1)

for i in range(k):
  d=int(input())
  a=list(map(int, input().split()))
  ans=0
  for i in range(len(a)):
    count[i]+=1
print(count.count(0))

Submission status: Wrong Answer

Solution code:
x=input()
x_list=x.split()
N=int(x_list[0])
K=int(x_list[1])

Z=set()

for i in range(K):
  s=int(input())
  c=input()
  c_list=c.split()
  Z.add(c.split)

print(N-len(Z))

Submission status: Wrong Answer

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

for i in range(k):
    d=int(input())
    l.append(map(int,input().split()))
    
x=set(l)
x=list(x)
print(n-len(x))

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
L = [list(map(int, input().split())) for i in range(2*k)]
A = []
for i in range(k-1):
  A = A + L[2*i + 1]
ans = 0
for i in range(n):
  if i+1 not in A:
    ans += 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
l=[]
count=0
for _ in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    l+=a
for i in range(1,n+1):
    if i in l:
        count+=1
print(count)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
lst = []
for i in range(k):
  d = int(input())
  a = list(map(int, input().split()))
  lst.append(d)
print(n-d)

Submission status: Wrong Answer

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

a=set()

for _ in range(K):
  X=int(input())
  Y=list(map(int,input().split()))
  for b in Y:
    a.add(b)
print(3-len(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
check = [False for i in range(n)]

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

print(check.count(True))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
b = []
c = []
for i in range(a[1] // 2):
  b.append(int(input()))
  for f in list(map(int, input().split())):
    c.append(f)  
d = len(set((c)))
print(a[0] - d)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
s = set()
for i in [0]*k:
  _ = input()
  s|=set(map(int,input().split()))
print(k-len(s))

Submission status: Wrong Answer

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

for m in range(0, k):
  d = int(input())
  li = [int(i) for i in input().split()]
  lis = lis + li
  
print(lis)
  
for s in range(1, n+1):
  if s in lis:
    count += 0
  else:
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
d=int(input())
if n-d >=0:
	print(n-d)
else:
	print('0')

Submission status: Wrong Answer

Solution code:
def check(human):
    sum = 0
    for i in human:
        if(i == 0):
            sum += 1
    return sum

def resolve():
    data = [int(i) for i in input().split()]
    
    human = [0 for i in range(data[0])]
    sweet = data[1]
    
    for i in range(sweet):
        mem = int(input())
        have = [int(j) for j in input().split()]
        
        for k in have:
            human[k-1] += 1
    
    print(check(human))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
count = [0 for _ in range(n)]

for _ in range(k):
    k = int(input())
    a = list(map(int, input().split()))
    for i in a:
        count[i - 1] += 1
a = ''
for i in range(len(count)):
    if count[i] == 0:
        a += str(i + 1) +' '
print(a)

Submission status: Wrong Answer

Solution code:
import fileinput

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

import sys
s = sys.stdin.readlines()
di = dict()
for d in s[0::2]:
    di[d] = True

print(N-len(di.keys()))

Submission status: Wrong Answer

Solution code:
import fileinput

N, K = map(int, input().split(" "))
print("N: {}, K: {}".format(N, K))

import sys
s = sys.stdin.readlines()
di = dict()
for d in s[0::2]:
    di[d] = True

print(N-len(di.keys()))

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
s = []
ans = 0
for i in range(k):
  d = int(input())
  A = list(map(int,input().split()))
  for i in range(d):
    s.append(A[i])
print(s)
for i in range(n+1):
  if s.count(i) == 0:
    ans += 1
    
print(ans-1)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
s = []
ans = 0
for i in range(k):
  d = int(input())
  A = list(map(int,input().split()))
  for i in range(d):
    s.append(A[i])
  
for i in range(k+1):
  if s.count(i) == 0:
    ans += 1
    
print(ans-1)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
s = []
ans = 0
for i in range(k):
  d = int(input())
  A = list(map(int,input().split()))
  for i in range(d):
    s.append(A[i])
  
for i in range(k+1):
  if s.count(i+1) == 0:
    ans += 1
    
print(ans-1)

Submission status: Wrong Answer

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

does_have = [False]*N
for _ in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    does_have[a-1] = True

print(sum(does_have))

Submission status: Wrong Answer

Solution code:
n,k = map(int, input().split())
a = set()
for i in [0]*k:
    _ = input()
    a.add(map(int, input().split()))
print(n - len(a))

Submission status: Wrong Answer

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

sweet=[0 for i in range(N)]

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

for i in d:
    for j in range(i):
        sweet[j]=1

num=0
for i in range(N):
    if sweet[i]==0:
        num+=1

print(num)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
humans = [x+1 for x in range(n)]

for _ in range(k):
    d = int(input())
    l = list(map(int,input().split()))
    for i in humans:
        if i in l:
            humans.remove(i)
print(len(humans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
t=[0]*N
for _ in range(K):
    d=int(input())
    a=list(map(int,input().split()))
for k in a:
    t[k-1]+=1

print(t.count(0))

Submission status: Wrong Answer

Solution code:
import itertools
N,K=map(int,input().split())
A=[]
for i in range(K):
    a=list(map(int,input().split()))
    if i%2==1:
        A.append(a)
x=list(itertools.chain.from_iterable(A))
print(N-len(set(x)))

Submission status: Wrong Answer

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

d=[]
A=[]

U=set(range(1,N))
X=set()

for i in range(K):
    d.append(int(input()))

    S=map(int,input().split())
    for s in S:
        X.add(s)

print(len(U-X))

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
a=[list(map(int,input().split())) for _ in range(2*k)]
b=[]
for i in range(k):
  b += a[2*i]
c=set(b)
print(n-len(c))

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
arr=[]
ans=[str(i) for  i in range(1,N+1)]
for i in range(K):
    _=input()
    arr.extend((input().split()))
    arr=list(set(arr))
p=0

for n  in  ans:
    if(n in arr)   :
        p=p+1
print(p)

Submission status: Wrong Answer

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

sunukes = list()
for i in range(1,k+1):
    sunukes.append(i)

sunukes = set(sunukes)

for i in range(1,k+1):
    input()
    sunukes = sunukes - set(map(int,input().split()))

print(len(sunukes))

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
Data = [0]*N
print(K)
for k in range(K):
    _ = input()
    user = list(map(int,input().split()))
    for u in user:
        Data[u-1] += 1
ans = 0
for i in range(N):
    if Data[i] == 0:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N, K = list(map(int, input().split()))
for i in range(1, K+1):
    d = int(input())
    N = map(int, input().split())
    print(d)
    print(N)

Submission status: Wrong Answer

Solution code:
n,k = [int(x) for x in input().split(' ')]
 
def solve(n, k):
    snukes = [None] * n
    victims = 0
    
    for i in range(k):
        snacks = int(input())
        snukes_snacks = [int(z) for z in input().split(' ')]
        for j in range(snacks):
            snukes[snukes_snacks[j] - 1] = snukes_snacks[j]
    
    print(snukes)
    for w in range(n):
        if snukes[w] is None:
            victims += 1
    
    print(victims)
 
solve(n, k)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    s = input()

    if s == "ABC":
        print("ARC")
    if s == "ARC":
        print("ABC")

Submission status: Wrong Answer

Solution code:
import itertools
N,K = list(map(int, input().split(" ")))
A = list(itertools.chain.from_iterable([input().split(" ")  for i in range(K) if input().split(" ")]))
A = list(map(int, A))
none = [a for a in range(1, K + 1) if a not in A]
print(len(none))