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:
def main():
	n,k = map(int,input().split())
	da = []
	for i in range(k*2):
		da.append(list(map(int,input().split())))
	print(da)
	okashi = []
	for i in range(1,k*2,2):
		if len(da[i]) > 1:
			for s in range(len(da[i])):
				okashi.append(da[i][s])
		else:
			okashi.append(da[i][0])
	print(n - len(set(okashi)))




if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
L = list(range(1,N))
for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for a in A:
    try:
      L.remove(a)
    except ValueError:
      pass
print(len(L))

Submission status: Wrong Answer

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

ans = [0]*n

for i,s in enumerate(S):
    for d in s:
        print(d)
        ans[int(d)-1]+=1


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

Submission status: Wrong Answer

Solution code:
n,k=[int(x) for x in input().split()]
a=set()
for i in range(k):
    a.add(input())
    b=input()
print(n-len(a))

Submission status: Wrong Answer

Solution code:
N, K = input().split()
user_have_sweets = set()
for i in range(int(K)):
    sweets_number = input()
    tmp_user = set(input())
    user_have_sweets |= tmp_user

all_user = set(map(str, set(range(1, int(N)+1))))

user_have_no_sweets = all_user - user_have_sweets
print(len(user_have_no_sweets))
# print(user_have_no_sweets)
# print(user_have_sweets)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
N, K = [int(n) for n in input().split()]
have_players = set()
for i in range(1, K):
    di = int(input())
    [have_players.add(n) for n in input().split()]
ans = N - len(have_players)
print(ans)

Submission status: Wrong Answer

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

sunuke_dict = {}
for i in range(K):
    d = int(input())
    sunuke_dict[d] = list(map(int,input().split()))
ans = [1]*(N+1)
ans[0]  =0
for v in sunuke_dict.values():
    for v_ in v:
        if ans[v_] == 1:
            ans[v_] =0
print(sum(ans))

Submission status: Wrong Answer

Solution code:
import collections

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

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

c = collections.Counter(a)

# print(c)
# print(c.values())
ans = 0
for i in range(n):
    if i+1 not in c.values():
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

ans = N - len(np.unique(A))
print(ans)

Submission status: Wrong Answer

Solution code:
n,k = map(int,input().split())
N = list(range(1,n+1))
A = set()
count = 0
for i in range(k):
  d = int(input())
  Ad = list(map(int,input().split()))
  for j in range(d):
    A.add(Ad[j])

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

Submission status: Wrong Answer

Solution code:
n,k=map(int,input().split())
List=[]
for i in range(k):
    di=int(input())
    Li=input()
    List.append(Li)
s=set(List)
print(n-len(s))

Submission status: Wrong Answer

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

treated = (list(range(1, N)))

for i in range(int((K+1)/2)):
  tt = list(set(list(range(1, N))) - set(l[2*i+1]))
  treated = list(set(treated) & set(tt))

print(len(treated))

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
for i in range(k):
    d = int(input())
    A = set([int(x) for x in input().split()])
print(len(A))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

set_i = set()

for i in range(0,k,2):
  d = input()
  s = map(int,input().split())
  for s_ in s:
    set_i.add(s_)

print(n-len(set_i))

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
ans_list = []
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    flag = 0
    while(flag == 0):
        if A[-1] > len(ans_list):
            ans_list.append(0)
        else:
            flag += 1
    for j in range(d):
        ans_list[A[j] - 1] += 1
ans = ans_list.count(0)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import sys
n, k =map(int,input().split())
d = int(input())

for e in sys.stdin:
    l=e

print(n-d)

Submission status: Wrong Answer

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

print(n - d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 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():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()

    N = int(next(tokens))  # type: str
    K = int(next(tokens))  # type: str
    # print(N, K)
    g = set()
    for _ in range(K):
        d = int(next(tokens))
        g = g  or set([int(next(tokens)) for i in range(d)])

    print(N - len(g))    

    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

for v in range(k):
    d_ = int(input())
    d__ = input()
    d_l = list(map(int, d__.split(" ")))
    for v in range(d_):
        m = d_l[v]
        L[m-1] += 1
L.count(0)

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 = []    
for i in range(1, n+1):
    N.append(i)
print(A,N)
print(len(set(A)^set(N)))

Submission status: Wrong Answer

Solution code:
(n, k) = list(map(int, input().split()))
snk = set(range(1, n))
items = []
for i in range(k):
    d = int(input())
    alist = list(map(int, input().split()))
    for a in alist:
        if a in snk:
            snk.remove(a)
print(len(snk))

Submission status: Wrong Answer

Solution code:
O= input()
N ,K = O.split()
list=[]
for i in range(int(K)):
    new = input()
    new2= input()
    list.append(new2)
list= set(list)
length = len(list)
print(int(N) - length)

Submission status: Wrong Answer

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



print(N-max(d))

Submission status: Wrong Answer

Solution code:
[N, K] = list(map(int, input().split()))
dList = []
AList = []
snuckSnack = {}
for i in range(K):
    dList.append(int(input()))
    AList.append(set(map(int, input().split())))
for i in range(1,N+1):
    snuckSnack[i] = set()
for i in dList:
    snuckSnack[i].update(AList[dList.index(i)])
vicCount = 0
for i in range(1,N+1):
    if snuckSnack[i] == set():
        vicCount += 1
print(vicCount)

Submission status: Wrong Answer

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

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

for i in range(0,k+1,2):
  syoji = sunukes[i]
  okashi = sunukes[i+1]
  for n in okashi:
    if n in names:
      names.remove(n)

print(len(names))

Submission status: Wrong Answer

Solution code:
n, k = [int(i) for i in input().split(' ')]
a, d = [], []
for i in range(2*k):
  if (i%2)==0:
    d.append(int(input()))
  else:
    a.append([int(j) for j in input().split(' ')])


c = 0
for i in range(1, n+1):
  if i not in d:
    c += 1
    
print(c)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    n, k = map(int, input().split())
    d_list = []
    a_list = []
    for i in range(k):
        d_list.append(int(input()))
        a_list.append(list(map(int, input().split())))

    remain_list = [i for i in range(1, 3+1)]

    for a in a_list:
        for sunuke_no in a:
            try:
                remain_list.remove(sunuke_no)
            except:
                pass

    print(len(remain_list))



if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
unchecked = set((range(1,N+1)))
#print(unchecked)
checked = set()

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

print(checked)
#unchecked -= checked
print(len(unchecked))

Submission status: Wrong Answer

Solution code:
def getN():
    return int(input())

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


def main():

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

    slist = [0] * N

    for i in range(K):
        d = getN()
        A = getIntList()
        for j in range(d):
            slist[j] += 1
    
    print(slist.count(0))
    
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

x = -1
for i in range(n):
  if l[i] == 0:
    x += 1
  
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
s = set()
for _ in range(k):
    input()
    s.add(map(int, input().split()))
print(n - len(s))

Submission status: Wrong Answer

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

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

having_okasi = set()
for _ in range(k):
    d = int(input())
    if d == 1:
        having_okasi.add(int(input()))
    else:
        having_okasi.add(map(int, input().split()))

print(n - len(having_okasi))

Submission status: Wrong Answer

Solution code:
import itertools

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

mans = []
for i in range(1, N+1):
    mans.append(i)

hasmans=[]
for ii in range(K):
    d = int(input())
    hasmans.append(list(map(int, input().split())))

hasmans = itertools.chain.from_iterable(hasmans)

print(*list(set(mans) - set(hasmans)))

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

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

    for a in A:
        people[a-1] = True

print(len(list(filter(lambda x : x, people))))

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

import itertools
n, k = LI()
s = []
for i in range(k):
    d = int(input())
    a = LI()
    s.append(a)
s = list(itertools.chain.from_iterable(s))
ans = 0
for i in range(1, n):
    if i not in s:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
treat = []
for i in range(K):
    d = int(input())
    snack = input().split()
    for l in snack:
        if snack not in treat:
            treat.append(snack)
print(N-len(treat))

Submission status: Wrong Answer

Solution code:

n,k = map(int,input().split())
l = [0]*n

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

    for j in range(1,len(a)+1):
        l[j-1] += 1

print(l.count(0))

Submission status: Wrong Answer

Solution code:

N, K = map(int, input().split())
#S = input()
Ai_list = []

for i in range(K):
    di = int(input())
    Ai_list += input().split()

print(Ai_list)
print(N - len(set(Ai_list)))

Submission status: Wrong Answer

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    N, K = map(int, input().split())
    s_list = [x for x in range(1, N)] 
    
    for i in range(K):
        di = int(input())
        A_i = list(map(int, input().split()))
        for j in A_i:
            try:
                s_list.remove(j)
            except:
                continue

    logging.info(s_list)
    print(len(s_list))
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

result = 0 
A_all = list(itertools.chain.from_iterable(A_all))
for i in range(1, N + 1):
  if A_all.count(i) == 0:
    print(i)
    result += 1
      
print(result)

Submission status: Wrong Answer

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

    max_d = 0
    for i in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        max_d = max(max_d, d)

    print(N - max_d)

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
anslist = [1] * (n + 1)
for x in range(k):
    d = int(input())
    list = input()
    for a in range(len(list)):
        if list[a] == ' ': continue
        anslist[int(list[a])] = 0
print(sum(anslist) - 1)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

sunuke = ["{}".format(i) for i in range(1,n+1)]

for i in range(k):
    d = int(input())
    a = input()
    for i in a:
        if i in sunuke:
            sunuke.remove(i)

ans = len(sunuke)

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

Submission status: Wrong Answer

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



print(N-max(d))

Submission status: Wrong Answer

Solution code:
a = input().split()

n = int(a[0])
k = int(a[1])

d = input()
d = int(d)

print(n-d)

Submission status: Wrong Answer

Solution code:
N, K = [int(x) for x in input().split()]
s = set()
for i in range(K):
    d = int(input())
    if d == 1:
        s.add(int(input()))
    else:
        for a in input().split():
            s.add(int(a))
ans = sum([a not in s for a in range(1, K+1)])
print(ans)

Submission status: Wrong Answer

Solution code:
n, k = input().split()
sunuke = []

for i in range(0, int(n)):
  sunuke.append(0)

for i in range(0, int(k)):
  okashi = input()
  mochi = list(map(int, input().split()))
  for j in range(0, len(mochi)):
    sunuke[j-1] += 1
    
print(sunuke.count(0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
dlist=[]
Alist=[]
for i in range(K):
    dlist.append(input())
    Alist.append(list(map(int,input().split()))[0])

#print(Alist)
Alist=list(set(Alist))
#print(Alist)
print(N-len(Alist))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,k=mis()
    nlis=[0]*(n+1)
    for _ in range(k):
        d=ii()
        a=input().split()
        for i in range(len(a)):
            x=int(a[i])
            nlis[x]+=1
    cnt=0
    for i in range(n):
        if nlis[i]==0: cnt+=1
    print(cnt-1)



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#整数の入力
N,K = map(int, input().split())

d_list = []
A_list_list = []
for i in range(K):
  #整数の入力
  d = int(input())
  d_list.append(d)
  #スペース区切りの整数の入力リスト
  A_list = list(map(int, input().split()))
  A_list_list.append(A_list)
  
counter = 0
for i in range(N):
  if((i+1 in A_list) ==True):
    counter = counter
  else:
    counter = counter + 1
print(counter)

Submission status: Wrong Answer

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

okashi = set(list(range(1, n)))

for i in range(k):
    d = int(input())
    A = set(map(int, input().split()))
    okashi = okashi - A 
print(len(okashi))

Submission status: Wrong Answer

Solution code:
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()


arg = list(map(int, input().split())) # 1行, 配列

N = arg[0]
K = arg[1]
S = range(1,N)
l = []

for i in range(K):
  D = int(input()) # 1行, 単数
  A = list(map(int, input().split())) # 1行, 配列
  for j in A:
    l.append(j)


AM = list(set(S) - set(l))

print(len(AM))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# n,m = map(int,sys.stdin.readline().split())
# a = list(map(int,sys.stdin.readline().split()))
# a = [sys.stdin.readline() for _ in range(n)]
# s = sys.stdin.readline().rstrip()
# n = int(sys.stdin.readline())
import sys,bisect,math
sys.setrecursionlimit(15000)

N,K = map(int,sys.stdin.readline().split())
s = set(range(1,N))
for _ in range(K):
    d = int(sys.stdin.readline())
    a = set(map(int,sys.stdin.readline().split()))
    s = s-a
print(len(s))

Submission status: Wrong Answer

Solution code:

n,k = map(int,input().split())
dlist = list(range(1,k+1))
d = []
for i in range(k):
    d.append(int(input()))
    a = list(map(int,input().split()))
    for j in range(len(a)):
        if a[j] in dlist:
            dlist.remove(a[j])

print(len(dlist))

Submission status: Wrong Answer

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

ans = [0]*n

for i,s in enumerate(S):
    for d in s:
        ans[int(d[0])-1]+=1

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

Submission status: Wrong Answer

Solution code:
N, K = [int(x) for x in input().split(" ")]
A = [0 for i in range(N)]

for k in range(K):
    d_i = int(input())
    holder_list = [int(x) for x in input().split(" ")]

    for hi in holder_list:
        A[hi-1] += 1

count_non_holder = 0
for a in range(len(A)):
    if a == 0:
        count_non_holder += 1

print(count_non_holder)

Submission status: Wrong Answer

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

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())))
    
import collections
c = collections.Counter(d)

print(n-len(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

sunukes = [0] * N

for i in range(K):
    d = int(input())
    kashimochi = list(map(int, input().split()))
    for j in range(len(kashimochi)):
        sunukes[j-1] = 1


print(sunukes.count(0))

Submission status: Wrong Answer

Solution code:
import numpy as np
n, k = input().split(' ')
dds = []
aas = []
for i in range(int(k)):
  dds.append(int(input()))
  aas.append(list(map(lambda x: int(x), input().split(' '))))
  

uni = len(np.unique(np.array(aas).flatten()))

print(int(n) - uni)

Submission status: Wrong Answer

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

print(n-len(a))

Submission status: Wrong Answer

Solution code:
[N, K] = list(map(int, input().split()))
dList = []
AList = []
snuckSnack = {}
for i in range(K):
    dList.append(int(input()))
    AList.append(list(map(int, input().split())))
for i in range(1,N+1):
    snuckSnack[i] = 0
for i in dList:
    snuckSnack[i] = 1
vicCount = 0
for i in range(1,N+1):
    if snuckSnack[i] == 0:
        vicCount += 1
print(vicCount)

Submission status: Wrong Answer

Solution code:
n, _ = map(int, input().split())
s = int(input())
print(n - s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = {}

for i in range(m):
    input()
    L = list(map(int,input().split()))
    for j in L:
        d[j] = j

print(n - len(L))

Submission status: Wrong Answer

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

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

print(N - len(set(d)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple


def solve(values: List[int], nb: int) -> int:
    for _v in values:
        pass
    return nb


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    N, K = map(int, input().split())
    snukes = [0] * N
    for _ in range(K):
        d = int(input())
        values = map(int, input().split())
        snukes[d % N] += sum(values)
    # values = []
    # for _ in range(N):
    #     values.append(input().split())
    result = snukes.count(0)
    print(result)


def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))


def configure_log() -> None:
    "Configure the log output"
    log_formatter = logging.Formatter("%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)

Submission status: Wrong Answer

Solution code:
import sys

def main():
    N, K = map(int, input().split())

    sunuke = []
    for _ in range(K):
        _ = input()
        next_sunuke = list(map(int, input().split()))
        for i in next_sunuke:
            sunuke.append(i)

    print(sunuke)
    sunuke = set(sunuke)

    print(N - len(sunuke))

    return

if __name__ == '__main__':
    main()
    sys.exit(0)

Submission status: Wrong Answer

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

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

A.sort

for k in range(1, K+1):
  if k in A:
    continue
    
  else:
    ans += 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
n,k = [int(ch) for ch in input().split()]
snuckList = []
for i in range(n):
    snuckList.append(i+1)
for i in range(k):
    snuck = int(input())
    snackList = input()
    if snuck in snuckList:
        snuckList.remove(snuck)
print(len(snuckList))

Submission status: Wrong Answer

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


for p in range(N):
    for i in range(K):
        if p in A[i]:
            ps[p-1]=0

print(sum(ps)-1)

Submission status: Wrong Answer

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

okashi = [0 for _ in range(n)]

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
N,K=map(int,input().split())
ans=[0]*N
print(ans)

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


ac = Counter(ans)

print(ac[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = set()

for k in range(K):
  input()
  s.add(tuple(map(int, input().split())))
  
print(N-len(s))

Submission status: Wrong Answer

Solution code:
import sys
import math
import bisect

def main():
    n, k = map(int, input().split())
    d = int(input())
    print(n - d)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    d=int(readline())

    dic={}
    for i in range(k):
        arr=list(readline().rstrip().split())
        for a in arr:
            dic[a]=1
    #ans=d-len(dic.keys())
    print(n-d)
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Wrong Answer

Solution code:
from collections import Counter as counter

ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########

n,k = mi()
res = 0
a = []
for i in range(k):
    d = input()
    a.extend(mi())
c = counter(a)
for i in range(1,k+1):
    if c[i] == 0: res+=1
print(res)

Submission status: Wrong Answer

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

l = str(l)
print(l.count('0'))

Submission status: Wrong Answer

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

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

sunuke = [i for i in range(1,N+1)]

for a in A:
	for s in sunuke:
		if s in a:
			sunuke.remove(s)

print(len(sunuke))

Submission status: Wrong Answer

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

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

A=list(set(A))
ans=N

for k in range(1,N+1):
    if k in A:
        ans=ans-1
print(ans)

Submission status: Wrong Answer

Solution code:
N,K = map(int,input().split())
unchecked = set(list(range(1,N)))
checked = set()

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

unchecked = unchecked - checked
print(len(unchecked))

Submission status: Wrong Answer

Solution code:
#b
n,k =map(int,input().split())
a = []

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