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:
N,K=map(int,input().split())
S=[]
b=0

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

for i in (len(S)):
    if S[i]==0:
        b+=1
print(b)

Submission status: Runtime Error

Solution code:
import numpy as np
n,k = map(int,input().split())
l = np.zeros((n,k))
for i in range(k):
    d = int(input())
    tmp = list(map(int,input().split()))
    for j in tmp:
        l[j-1][d-1] = 1
print(len(l[np.all(l < 1,axis=1),:]))

Submission status: Runtime Error

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

sunuke = [0] * n
 
for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        sunuke[j-1] = 0

print(sum(sunuke))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
for s in Sunuke:
  if s == 0:
     ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
for okashi_number in range(k):
	di = int(input())
	D = map(int,input().split())
	for x in range(di)
		A[[x]-1] = 1

for i in range(N):
	if A[i] == 0:
	print(A[i])

Submission status: Runtime Error

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

snk = [False] * n

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
start_time = time.perf_counter()
# ------------------------------

N, K = inpl()
dp = [False] * N
for i in range(K):
    d = inp()
    A = inpl()
    for a in A:
        dp[A-1] = True
cnt = 0
for bl in dp:
    if not bl:
        cnt += 1
print(cnt)

# -----------------------------
end_time = time.perf_counter()
print('time:', end_time-start_time, file=sys.stderr)

Submission status: Runtime Error

Solution code:
# abc166_b.py
# https://atcoder.jp/contests/abc166/tasks/abc166_b

# B - Trick or Treat /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# ある街に、N人のすぬけ君(すぬけ君 1 、すぬけ君 2 、 ...、 すぬけ君 N)が住んでいます。
# この街には、 K種類のお菓子(お菓子 1 、 お菓子 2 、....、お菓子 K )が売られています。
# お菓子 i を持っているのは、すぬけ君 Ai,1,Ai,2,⋯,Ai,di の計 di人です。
# 高橋君は今からこの街を回り、お菓子を 1つも持っていないすぬけ君にいたずらをします。
# このとき、何人のすぬけ君がいたずらを受けるでしょうか。

# 制約
#     入力は全て整数
#     1≤N≤100
#     1≤K≤100
#     1≤di≤N
#     1≤Ai,1<⋯<Ai,di≤N

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N K
# d1
# A1,1⋯A1,d1
# ⋮
# dK
# AK,1⋯AK,dK

# 出力
# 答えを出力せよ。

# 入力例 1
# 3 2
# 2
# 1 3
# 1
# 3

# 出力例 1
# 1

#     すぬけ君 1はお菓子 1を持っています。
#     すぬけ君 2はお菓子を持っていません。
#     すぬけ君 3はお菓子 1,2を持っています。
# 以上より、いたずらを受けるのはすぬけ君 2の一人です。

# 入力例 2
# 3 3
# 1
# 3
# 1
# 3
# 1
# 3

# 出力例 2
# 2


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    # N = int(lines[0])
    N, K = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    values_d = list()
    valueses = list()
    log(f'len(lines)=[{len(lines)}]')
    for i in range(K):
        log(f'i=[{i}]')
        values_d.append(int(lines[i*2+1]))
        valueses.append(list(map(int, lines[i*2+2].split())))

    log(f'N=[{N}], K=[{K}]')
    log(f'values_d=[{values_d}]')
    log(f'valueses=[{valueses}]')

    sunukes = [0] * N

    for value_d, values in zip(values_d, valueses):
        for value in values:
            sunukes[value-1] += 1

    result = 0
    for sunuke in sunukes:
        if sunuke == 0:
            result += 1

    return [result]


# 引数を取得
def get_input_lines():
    line = input()
    N, K = list(map(int, line.split()))
    lines = list()
    lines.append(line)
    for _ in range(K+1):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 2', '2', '1 3', '1', '3']
        lines_export = [1]
    if pattern == 2:
        lines_input = ['3 3', '1', '3', '1', '3', '1', '3']
        lines_export = [2]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines()
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# abc166_b.py
# https://atcoder.jp/contests/abc166/tasks/abc166_b

# B - Trick or Treat /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# ある街に、N人のすぬけ君(すぬけ君 1 、すぬけ君 2 、 ...、 すぬけ君 N)が住んでいます。
# この街には、 K種類のお菓子(お菓子 1 、 お菓子 2 、....、お菓子 K )が売られています。
# お菓子 i を持っているのは、すぬけ君 Ai,1,Ai,2,⋯,Ai,di の計 di人です。
# 高橋君は今からこの街を回り、お菓子を 1つも持っていないすぬけ君にいたずらをします。
# このとき、何人のすぬけ君がいたずらを受けるでしょうか。

# 制約
#     入力は全て整数
#     1≤N≤100
#     1≤K≤100
#     1≤di≤N
#     1≤Ai,1<⋯<Ai,di≤N

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N K
# d1
# A1,1⋯A1,d1
# ⋮
# dK
# AK,1⋯AK,dK

# 出力
# 答えを出力せよ。

# 入力例 1
# 3 2
# 2
# 1 3
# 1
# 3

# 出力例 1
# 1

#     すぬけ君 1はお菓子 1を持っています。
#     すぬけ君 2はお菓子を持っていません。
#     すぬけ君 3はお菓子 1,2を持っています。
# 以上より、いたずらを受けるのはすぬけ君 2の一人です。

# 入力例 2
# 3 3
# 1
# 3
# 1
# 3
# 1
# 3

# 出力例 2
# 2


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    # N = int(lines[0])
    N, K = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    values_d = list()
    valueses = list()
    log(f'len(lines)=[{len(lines)}]')
    for i in range(K):
        log(f'i=[{i}]')
        values_d.append(int(lines[i*2+1]))
        valueses.append(list(map(int, lines[i*2+2].split())))

    log(f'N=[{N}], K=[{K}]')
    log(f'values_d=[{values_d}]')
    log(f'valueses=[{valueses}]')

    sunukes = [0] * N

    for value_d, values in zip(values_d, valueses):
        for value in values:
            sunukes[value-1] += 1

    result = 0
    for sunuke in sunukes:
        if sunuke == 0:
            result += 1

    return [result]


# 引数を取得
def get_input_lines():
    line = input()
    N, K = list(map(int, line.split()))
    lines = list()
    lines.append(line)
    for _ in range(K+1):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 2', '2', '1 3', '1', '3']
        lines_export = [1]
    if pattern == 2:
        lines_input = ['3 3', '1', '3', '1', '3', '1', '3']
        lines_export = [2]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines()
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
  N,K=map(int,input().split())
  for i in range(K):
    input()
    a |= set(list(map(int,input.split())))
  print(n-len(a))
  
 
if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
# B Trick or Treat

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

sunuke = [0] * N
for i in k:
  d = int(input())
  a = list(map(int, input().split()))
  for ai in a:
    sunuke[ai-1] += 1
print(sunuke.count(0))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
x = int(input())
n = 100
y = 0

while x > n:
    # 小数点以下切り捨て
    n += n // 100
    y += 1

print(y)

Submission status: Runtime Error

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

A=[]

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

print(3)

Submission status: Runtime Error

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

A=[]

for i range(K)
    d = int(input())
    A[i] = [int(x) for x in input().split()]

print("A")

Submission status: Runtime Error

Solution code:
(n, k) = [int(x) for x in input().split()]

s = set()

for i in range(k):
    input()
    s |= set(input().split)
    
print(n-len(s))

Submission status: Runtime Error

Solution code:
(n, k) = [int(x) for x in input().split()]

s = set()

for i in range(k):
  input()
  s |= set(input().split)
    
print(n-len(s))

Submission status: Runtime Error

Solution code:
(n, k) = [int(x) for x in input().split()]

s = set()

for i in range(k):
	input()
    s |= set(input().split)
    
print(n-len(s))

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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 
print(sum(tmp))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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
 
print(sum(tmp))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

tmp = {}

for i in range(N):
  input()
  tmp |= set(map(int, input().split()))

print(len(set(range(1, N+1)) - tmp))

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
# お菓子を持っているすぬけ君かを判断する配列d 1ならもってる 0はもってない
d = [0] * n
# お菓子iを持っているのはどのすぬけ君か？
for i in range(k):
    # お菓子iを持っている人数m人
    m = int(input())
    # お菓子iを持っているすぬけ君のリスト
    a = list(map(int, input().split()))
    for j in a:
        # すぬけ君a[j]は少なくとも一つ以上のお菓子を持っている
        d[a[j]-1] = 1 
        
#いたずらされる人数ans人
ans = 0
for i in range(n):
    if d[i] == 0:
        ans += 1

print(ans)

Submission status: Runtime Error

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

C = [0 for _ in range(N)]
ct = N
for i in range(N):
  d = int(input())
  A = list(map(int, input().split()))
  for a in A:
    if C[a-1] == 0:
      C[a-1] += 1
      ct -= 1

print(ct)

Submission status: Runtime Error

Solution code:
n,k = map(int,imput().split())
ans = [1] * n

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

print(ans.count(1))

Submission status: Runtime Error

Solution code:
n,k = list(map(int,imput().split()))
ans = [1] * n

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

print(ans.count(1))

Submission status: Runtime Error

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

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

print(n - len(set(output)))

Submission status: Runtime Error

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

for i in range(k):
  d = int(input())
  for j in range(d):
    output.append(int(input()))

print(n - len(set(output)))

Submission status: Runtime Error

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

for i in range(1,k):
  d = int(input())
  for j in range(1,d):
    output.append(int(input()))

print(n - len(set(output)))

Submission status: Runtime Error

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

s = [t for t in range(1,N+1)]
for i in range(K):
    d = int(input())
    A = list(map(input().split()))
    if A[i] in s:
        s.remove(A[i])
    K -= 1
print(lne(s))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

n,k = Mi()
b = [1]*n
for i in range(k):
  d = Ii()
  a = Li()
  for j in a:
    b[j] = 0
    
print(sum(b)-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(c.count(0))

Submission status: Runtime Error

Solution code:
sunuke,var = map(int,input().split())
loser = [1] * sunuke
for i in range(var):
  d = int(input())
  buy = map(int(input().split())
  for t in buy:
    winer[t-1] = 0
print(sum(loser))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
have = [0] * n
for i in range (k):
  d = int(input())
  a = map(int,input().split())
  for j in a:
    have[i] += 1
ans = 0
for m in range (1,k+1):
  if have[m] == 0:
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
list = [0]*N
for _ in range(K):
    d = int(input()) 
    l2= list(map(int, input().split()))
    print(l2)
    for val in l2:
        list[val-1] = 1
print(N-sum(list))

Submission status: Runtime Error

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-1)
    for i in range(K-1):
        d = int(input())
        A = list(map(int, input().split()))
        for j in range(d-1):
            ans[A[j]] += 1

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N,K=(map(int,input().split()))
a=[i for i in range(1,N+1)]
d=[]
A=[]
b=[]
count=0
for i in (0,K):
    d.append(int(input()))
    A.append(list(map(int,input().split())))
for i in range(1,len(d)+1):
        if i in d:
            x=d.index(i)
            y=A[i-1]
            for j in range(0,len(y)):
                z=y[j]
                b.append(z)
b1=list(dict.fromkeys(b))
for i in b1:
    if i in a:
        count+=1
print(N-count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
  n, k = map(int, input().split())
  
  kids = list()
  sum = 0
  
  for i in k-1:
    dustbox = input()
    kids += list(map(int, input().split()))
    
  for i in range(1, n+1):
    if i not in kids:
      sum += 1
      
  print(sum)
  
main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
hello

Submission status: Runtime Error

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

N = set(range(1,n+1))

for i in range(1,k+1):
    d = int(input())
    a=set(map(int,input().split()))
    A += a

ans = list(N-A)

print(len(ans))

Submission status: Runtime Error

Solution code:
N, K = map(int, input().rstrip().split())
sunuke = [int(i) for i in range(1,N + 1)]
d = []
A = []

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

for k in range(K):
  for i in range(d[k]):
    for j in A[i]:
      if j in sunuke:
        sunuke.remove(j)
    
print(len(sunuke))

Submission status: Runtime Error

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

count=[0]*(n+1)

for i in range(n):
  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: Runtime Error

Solution code:
n,k=map(int,input().strip().split())
a=0
b=0
d=[]
for i in range(n):
    d.append(i)
for i in range(k):
    a=int(input())
    c=list(map(int,input().strip().split()))   
    for j in range(len(c)):
        if(d.count(c[j])>=1):
            d.pop(c[j])
print(len(d))

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
sweet = [0 for i in range(N)]
for i in range(K):
  input()
  for j in map(int, input().split()):
    sweet[j] = 1
cnt = 0
for k in sweet:
  if k == 0:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
#最初の2文字をインプット
n,k= map(int,input().split())

#空のお菓子リストを作成
sweets_have_li=[] #人数分のリスト
sweets_want_li=[] #人数分のリスト

#人数分のリスト
max_people=0
while max_people != n:
    sweets_want_li.append(max_people+1)
    max_people=max_people+1

#人数分のリスト
while k != 0:
    a=int(input())#１文字をインプット
    li = list(map(int,input().split()))#１行をインプット
    sweets_have_li.append(li)#インプットした１行をリストに加える
    k=k-1

sweets_have_li = sum(sweets_have_li, []) #配列を1次元化
sweets_have_li = list(set(sweets_have_li)) #set()で同じ要素をまとめる

#print(sweets_have_li)
#print(sweets_want_li)

Ans=[] #答えを入れるようの空配列を作成

while sweets_have_li !=[]: #リストが空になるまで
    if sweets_have_li[0] == sweets_want_li[0]: #先頭の要素を比較
        sweets_have_li.pop(0) #先頭の要素を切り取る
        sweets_want_li.pop(0) #先頭の要素を切り取る
    else:
        Ans.append(sweets_want_li[0]) #先頭の要素を答えの配列に追加 (Ansにはお菓子を持っていない人の番号が入る)
        sweets_want_li.pop(0) #先頭の要素を切り取る

print (len(Ans)) #お菓子を持っていない人の人数を出力

Submission status: Runtime Error

Solution code:
def main():
    count = 0
    ans = []
    N, K = map(int, input().split())
    for _ in range(K):
        d = int(input())
        a = [input() for _ in range(d)]
        ans.append(a)
    for _ in range(1, N + 1):
        if _ not in ans:
            count += 1

    print(count)
    return

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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()))
    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: Runtime Error

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

Submission status: Runtime Error

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

l = []
for _ in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    l = extend.A
    
result = n - len(set(l))
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

d = [0] * (K+1)
A = [[0] * (K+1) for i in range(N+1)]

for k in range(1, K+1):
    dk = int(input())
    d[k] = dk
    Ak = map(int, input().split())
    for a in Ak:
        A[a][dk] = A[a][dk] + 1

n = 0
for a in A:
    if sum(a) == 0:
        n = n + 1

print(n-1)

Submission status: Runtime Error

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):
  if s.count(i) == 0:
    ans += 1
    
print(ans)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

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

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

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

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

print(num)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
snuke = [0] * N
for n in range(N-1):
    snack = int(input())
    d_snuke = map(int, input().split())
    for d in d_snuke:
        snuke[d-1] = snack
c = 0
for n in range(N-1):
    if snuke[n] == 0:
        c += 1
print(c)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
snuke = [0] * N
for n in range(N-1):
    snack = int(input())
    d_snuke = map(int, input().split())
    for d in d_snuke:
        snuke[d-1] = snack
c = 0
for n in range(N):
    if snuke[n] == 0:
        c += 1
print(c)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
snuke = [0] * N
for n in range(N-1):
    snack = int(input())
    A = str(input())
    snuke[snack-1] = 1
c = 0
for n in range(N):
    if snuke[n] == 0:
        c += 1
print(c)

Submission status: Runtime Error

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

have_number=[]
have_who=[]

for i in range(K):
    i = input().split()
    j = input().split()
    have_number.append(i)
    have_who.append(j)

    #人
list1=[]
for k in range(1,N+1):
    list1.append(k)
    
#持っている人の番号
t_have_who=sum(have_who,[])
for c in range(0,N):
    t_have_who[c]=int(t_have_who[c])
t_have_who  

#人と持っている人の番号の非重複
list1=set(list1)
t_have_who =set( t_have_who )
co = list1 ^ t_have_who  

print(len(co))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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