TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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?

Submission attempts (in order):
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)

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
print(ls.count(0))

Verdicts: Wrong Answer

Accepted
Problem: 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?

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

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, k = map(int, input().split())

d = int(input())

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

print(n - d)

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

ans = []

for i in range(k*2):
  x = input().split()
  if 1 == i % 2:
    for j in range(len(x)):
      if int(x[j]) not in ans:
        ans.append(int(x[j]))

print(n - len(ans))


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,K=map(int,input().split())
a=set([])
for i in range(K):
    d=int(input())
    for i in range(d):
        L=list(map(int,input().split()))
        for x in L:
            a.add(x)
print(N-len(a))

N,K=map(int,input().split())
a=set([])
for i in range(K):
    d=int(input())
    L=list(map(int,input().split()))
    for x in L:
        a.add(x)
print(N-len(a))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)

print(len(unchecked))

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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)

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
print(L.count(0))

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):

n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    for j in range(d):
        list = list(input())
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)



n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    input = input()
    list = [int(ai) for ai in input ]
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)



n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    list = list(input().split())
    input_map.setdefault(d, list)

cnt = 0
for key, value in input_map.items():
    if len(value) >= key:
        cnt += 1

print(cnt)



n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    list = list(input().split())
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)



n, k = map(int, input().split())
input_map = {}
for i in range(k):
    d = int(input())
    for j in range(d):
        input_list = input().split()
        list = [ int(ai) for ai in input_input ]
    input_map.setdefault(i, list)

cnt = 0
having_list = input_map(k)
for j in having_list:
    cnt += 1

print(cnt)



n, k = map(int, input().split())
n_list = list(range(1, n+1))
input_map = {}
for i in range(k):
    d = int(input())
    d_list = [ int(ai) for ai in input().split()]
    input_map.setdefault(d, d_list)


having_map = {}
for key, value in input_map.items():
    for h in value:
        print(value)
        if n_list.count(h) >= 1:
            n_list.remove(h)

print(len(n_list))



n, k = map(int, input().split())
n_list = list(range(1, n+1))
input_map = {}
for i in range(k):
    d = int(input())
    d_list = [ int(ai) for ai in input().split()]
    for h in d_list:
        if n_list.count(h) == 1:
            n_list.remove(h)

print(len(n_list))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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?

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


#coding: utf-8
N, K = map(int, input().split())
A = [0 for _ in range(N)]
ans = 0
for i in range(K):
    d = int(input())
    tmp = list(map(int, input().split()))
    for j in range(d):
        A[tmp[j]-1] += 1
for i in range(N):
    if A[i] == 0:
        ans += 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)

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

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

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)

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:
        ans[int(d)-1]+=1


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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N, K = map(int, input().split())
di = K * 2
l = []

for i in range (di):
    l.append(int(input()))

l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))

N, K = map(int, input().split())
l = []

for i in range (K * 2):
    l.append(int(input())
l1 = []
x = 1
while x < K * 2:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l)
print(N - len(l1))

N, K = map(int, input().split())
di = K * 2
l = []
for i in range (di):
    l.append(input().split())
l1 = []
x = 1
while x < di:
    for j in l[x]:
        l1.append(j)
    x += 2
l1 = set(l1)
print(N - len(l1))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,K=map(int,input().split())
count=0
who=[]
while(K!=0):
    k=int(input())
    someone=list(map(int,input().split()))
    if(len(someone)!=0):
        for i in someone:
            who.append(i)
            someone.remove(i)
    K-=1
print(len(set(who)))

N,K=map(int,input().split())
who_have=[]
while(K!=0):
    k=int(input())
    someone_have=list(map(int,input().split()))
    if(len(someone_have)!=0):
        for i in someone_have:
            if(i in range(1,N+1)):
                who_have.append(i)
    K-=1
print(N-len(set(who_have)))

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
#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))

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N, K = map(int, input().split())
d = []
A = []

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

okashi = [0] * N

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

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

print(count)


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

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

okashi = [0] * N

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

print(okashi)
count = 0
for i in okashi:
    if i == 0:
        count += 1

print(count)


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

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

okashi = [0] * N

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

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

print(count)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n, k = map(int, input().split())
d_list = []
A_list  =[]
nuske = np.zeros(n)
print(nuske)
import numpy as np
for _ in range(k): 
    d = input()
    a = list(map(int, input().split()))
    for i in a:
        nuske[i-1] +=1

p =0

for i in range(len(nuske)):
    if nuske[i] ==0:
        p+=1

print(p)


n, k = map(int, input().split())
A_list  =[]
nuske = np.zeros(n)
import numpy as np
for _ in range(k): 
    d = input()
    a = list(map(int, input().split()))
    for i in a:
        nuske[ i-1] +=1

p =0

for i in range(len(nuske)):
    if nuske[i] ==0:
        p+=1

print(p)


n, k = map(int, input().split())
A_list  =[]
import numpy as np
nuske = np.zeros(n)

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

p =0

for i in range(len(nuske)):
    if nuske[i] ==0:
        p+=1

print(p)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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))

N, K = map(int, input().split())
Number = []
n = 0
c = 1
for i in range(K):
  d = int(input())
  A = [int(x) for x in input().split()]
  Number.append(int(d))
for I in range(N):
  if c in A:
    c = c+1
  else:
    n = n+1
    c = c+1
print(n)

N, K = map(int, input().split())
c = 0
n = 1
List = []
for i in range(1,K):
  d = int(input())
  m = int(input())
  List.append(m)
for I in range(1,N):
  if n in List:
    n = n+1
  else:
    c = c+1
    n = n+1
print(c)

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

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

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

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

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

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

N, K = map(int, input().split())
c = 0
n = 1
w = 1
z = 1
while w<=K
  d = int(input())
  List = list(map(int, input().split()))
  w = w+1
while w<=N
  if n in List:
    n = n+1
    z = z+1
  else:
    c = c+1
    n = n+1
    z = z+1
print(c)

def resolve():
    N, K = map(int, input().split())
    D = []
    A = []
    for _ in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        D.append(d)
        A.append(a)
    ans = 0
    for i in range(N):
        flag = 0
        for j in range(K):
            if i+1 in A[j]:
                flag = 1
        if flag == 0:
            ans += 1
    print(ans)
resolve()

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
NK = list(map(int, input().split()))
N=NK[0]
K=NK[1]
sunukes = [i+1 for i in range(N)]
for i in range(K):
  d = int(input())
  A = map(int, input().split())
  for a in A:
    if a in sunukes:
      sunukes.remove(a)

print(sunukes)

NK = list(map(int, input().split()))
N=NK[0]
K=NK[1]
sunukes = [i+1 for i in range(N)]
for i in range(K):
  d = int(input())
  A = map(int, input().split())
  for a in A:
    if a in sunukes:
      sunukes.remove(a)

print(len(sunukes))



Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):






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

sum=0

#List = ['A','B','C','D','E']
#List=list(range(1))
List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)

#print(List_A_all)

for t in range(N):
    if not t in List_A_all:
        sum+=1


#print(List_d)
print(sum)




#    X,Y,Z= map(int, input().split())
#    List=[X,Y,Z]

#List.sort()
#print(List[1])


 

#print(int(sum))

#print(List.index(S)+1)

#salary = 0

#sum=0

#print(N)
#while sum!=N:

#    print(1)
#    sum+=1






#
#salary = int(salary)









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

sum=0

#List = ['A','B','C','D','E']
#List=list(range(1))
List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)

#print(List_A_all)

for t in range(N):
    if not t+1 in List_A_all:
        sum+=1


#print(List_d)
print(sum)




#    X,Y,Z= map(int, input().split())
#    List=[X,Y,Z]

#List.sort()
#print(List[1])


 

#print(int(sum))

#print(List.index(S)+1)

#salary = 0

#sum=0

#print(N)
#while sum!=N:

#    print(1)
#    sum+=1






#
#salary = int(salary)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
def main(n, a):
    indexes = {i + 1 for i in range(n)}
    reduced = set()
    for s in a:
        reduced |= s
    return len(indexes - reduced)


if __name__ == '__main__':
    S = input().rstrip()
    N, K = map(int, input().split())
    A = []
    for _ in range(K):
        input()
        A.append(set(tuple(map(int, input().split(' ')))))
    print(main(N, A))


def main(n, a):
    indexes = {i + 1 for i in range(n)}
    reduced = set()
    for s in a:
        reduced |= s
    return len(indexes - reduced)


if __name__ == '__main__':
    S = input().rstrip()
    N, K = map(int, input().split())
    A = []
    for _ in range(K):
        input()
        A.append(set(tuple(map(int, input().split(' ')))))
    print(main(N, A))


N, K = map(int, input().split(' '))
S = set([i + 1 for i in range(N)])

for _ in range(K):
    input()
    S -= set(map(int, input().split(' ')))

print(len(S))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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))

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+1 in a[j]:
            cnt += 1
    if cnt == 0:
        num.append(i)
print(len(num))

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N, K = map(int, input().split())

susuke = [1] * N

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

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

susuke = [1] * N

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n, k = map(int, input().split())

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

oks = [False] * n
for xs in arr:
    for x in xs:
        oks[x - 1] = True

ans = 0
for x in oks:
    if x == False:
        ans += 1

print(ans)


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

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

oks = [False] * n
for xs in arr:
    for x in xs:
        oks[x - 1] = True

ans = 0
for x in oks:
    if x == False:
        ans += 1

print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n,k = map(int,input().split())
d = [0]*k
a = [0]*k
s = []
for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int,input().split()))
    s.extend(a[i])
d = set(s)

print(n-len(d))
print(s)

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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))



import itertools

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 = itertools.chain.from_iterable(a)
b = set(a)

print(N - len(b))


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
from copy import copy
from functool import reduce

class Sunkune:
	def __init__(self):
  		self.has_snack = False

n_sunuke, n_v_snacks = [int(s) for s in input().split(2)]

all_sunuke = [copy(Sunuke()) for i in range(n_sunuke)]

for snack_id in n_v_snacks:
  	n_snacks = int(input())
    for sunuke_id in (int(s) for s in input().split()):
    	all_sunuke[s - 1].has_snack = True

print(reduce(lambda n,s: n + (0 if s.has_snack else 1), all_sunuke, 0)

from copy import copy
from functools import reduce
    
class Sunuke:
    def __init__(self):
        self.has_snack = False
    
n_sunuke, n_v_snacks = [int(s) for s in input().split()]
    
all_sunuke = [copy(Sunuke()) for i in range(n_sunuke)]
    
for snack_id in range(n_v_snacks):
    n_snacks = int(input())
    for sunuke_id in (int(s) for s in input().split()):
        all_sunuke[sunuke_id - 1].has_snack = True
    
print(reduce(lambda n,s: n + (0 if s.has_snack else 1), all_sunuke, 0))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
# -*- coding: utf-8 -*-
n, k = map(int, input().split())

sunuke_list = [False for i in range(n)]

for i in range(k):
    d = int(input())
    has_sunuke_list = input().split()
    for k in has_sunuke_list:
        sunuke_list[int(k)-1] = True

print(sunuke_list.coutn(False))


# -*- coding: utf-8 -*-
n, k = map(int, input().split())

sunuke_list = [False for i in range(n)]

for i in range(k):
    d = int(input())
    has_sunuke_list = input().split()
    for k in has_sunuke_list:
        sunuke_list[int(k)-1] = True

print(sunuke_list.count(False))


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,K =map(int,input().split())
C =[]
D =[]

N1 = N +1
for o in range(1,N+1):
    D.append(o)
    
print(D)


for i in range(K):
    A =int(input())
    C.append(A)
    B =list(map(int,input().split()))
    for j in D:
        for z in B:
            if j ==z:
                D.remove(j)

print(D)
                
                
                
#print(E)
print(len(D))
            
    

N,K =map(int,input().split())
C =[]
D =[]

N1 = N +1
for o in range(1,N+1):
    D.append(o)
    
#print(D)


for i in range(K):
    A =int(input())
    C.append(A)
    B =list(map(int,input().split()))
    for z in B:
        for j in D:
            if j ==z:
                D.remove(j)

#print(D)
                
                
                
#print(E)
print(len(D))
            
    

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N, K = map(int, input().split())
mem = {}
for _ in range(K):
  _ = input()
  mem = mem | {input().split()}

mem_count = len(mem)
print(N-mem_count)

N, K = map(int, input().split())
mem = set()
for _ in range(K):
  _ = input()
  mem = mem | {input().split()}

mem_count = len(mem)
print(N-mem_count)

N, K = map(int, input().split())
mem = set()
for _ in range(K):
  _ = input()
  mem = mem | {input().split()}
mem_count = len(mem)
print(N-mem_count)

N, K = map(int, input().split())
mem = set()
for _ in range(K):
  _ = input()
  mem = mem | set(map(int, input().split()))

mem_count = len(mem)
print(K, mem_count, mem)
print(N-mem_count)

N, K = map(int, input().split())
mem = set()
for _ in range(K):
  _ = input()
  mem = mem | set(map(int, input().split()))

mem_count = len(mem)
print(N-mem_count)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,k=map(int,input().split())
ans=0
lis=[0 for i in range(n)]
for i in range(k):
  d=int(input())
  ll=map(int,input().split())
  for j in ll:
    lis[j-1]+=0
for i in lis:
  if i==0:
    ans+=1
    
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n, k = map(int, input().split())
ss = set()

for i in range(1, k*2+1):
  if i%2==1:
    pass
  else:
    for s_i in map(int, input().split()):
      ss.add(s_i)
print(len([s for s in range(1, n+1) if s not in ss]))


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

ss = set()

for i in range(1, k*2+1):
  #print(i)
  if i%2==1:
    input()#print('d', i//2+1, ': ', input())
  else:
    for s_i in map(int, input().split()):
      #print('s_i: ', s_i)
      ss.add(s_i)
#print(ss)
print(len([s for s in range(1, n+1) if s not in ss]))


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
from collections import defaultdict

N, K = list(map(int, input().split()))
d = defaultdict(list)
for x in range(K):
    input()
    for i in map(int, input().split()):
        d[i].append(True)
count = 0
for i in range(1, K):
    if len(d[i]) == 0:
        count += 1
print(count)


from collections import defaultdict

N, K = list(map(int, input().split()))
d = {}
for i in range(1, N+1):
    d[i] = []
print(d)
for k in range(1, K):
    input()
    for i in map(int, input().split()):
        d[i].append(k)
count = 0
for i in range(1, N+1):
    if len(d[i]) == 0:
        count += 1
print(count)


from collections import defaultdict

N, K = list(map(int, input().split()))
d = {}
for i in range(1, N+1):
    d[i] = []
for k in range(1, K+1):
    input()
    for i in map(int, input().split()):
        d[i].append(k)
count = 0
for i in range(1, N+1):
    if len(d[i]) == 0:
        count += 1
print(count)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,k = map(int, input().split())
di=[0]*k
Ap=[0]*n
for i in range(0,k):
    di[i] = int(input())
    A = list(map(int, input().split()))
    ai=0
    for j in range(1,di[i]+1):
        if A[ai]==j:
            ai=ai+1
            Ap[j-1]=1
num=0
for l in range(0,n):
    if Ap[l]==0:
        num=num+1
print(num)

n,k = map(int, input().split())
di=[0]*k
Ap=[0]*n
for i in range(0,k):
    di[i] = int(input())
    A = list(map(int, input().split()))
    ai=0
    A.append(-100)
    for j in range(1,n+1):
        if A[ai]==j:
            ai=ai+1
            Ap[j-1]=1
num=0
for l in range(0,n):
    if Ap[l]==0:
        num=num+1
print(num)

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =list(range(0,N-1))
for i in range(K):
    di = int(a[2i+1])
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
            	b.remove(l)
                bi.remove(l)
print(len(b))

n = input().split()
N = int(n[0])
K = int(n[1])
s = [list(map(int, input().split())) for i in range(2*K+1)] 
b = list(range(N))
for l in b:
    for i in range(K):
        di = s[2*i]
        ai = s[2*i+1]
        for k in ai:
            if k == l:
                b.remove(l)
                ai.remove(l)
print(len(b))

n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =[]
for i in range(K):
    di = int(a[2i+1])
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if not bi[k] == l:
            	b.append(l)
print(len(b))

n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = a0[0]
K = a0[1]
b = []
for i in range(K):
    di = a[2i+1]
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if not bi[k] == l:
            	b.append(l)
print(len(b))

n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = a0[0]
K = a0[1]
b = []
for i in range(K):
    di = a[2i+1]
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
                b.append(l)
print(len(b))

n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =list(range(0,N-1))
for i in range(K):
    di = int(a[2*i+1])
    bi = a[2*i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
            	b.remove(l)
                bi.remove(l)
print(len(b))

N, K = map(int, input().split())
d = []
A = []
s = [1] * N
for k in range(K):
  d.append(int(input()))
  A.append([int(i) for i in input().split()])
  
for k in range(K):
  for n in range(1, N+1):
    if n in A[k]:
      if s[n-1] == 1:
        s[n-1] = 0
print(sum(s))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N,K=map(int,input().split())
D=[]
A=set()
for i in range(K):
	D.append(input())
	A.add(int(input()))
S=len(A)
print(N-S)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)
  	

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:
    result += 1
      
print(result)
  	

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,K=map(int,input().split())

Sanuke=list(range(K))

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

temp=0

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

print(higaisha)

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

Sanuke=list(range(K))

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

higaisha=0

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

print(higaisha)

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

Sanuke=list(range(K))

def calc_double(n):
      return n -1

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

higaisha=0

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

print(higaisha)

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

Sanuke=list(range(K))

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

higaisha=0

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

print(higaisha)

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

ans=[0]*n

for i in range(k):
  d=int(input())
  a=[int(k) - 1 for k in input().split()]
  for j in a:
    ans[j]+=1

ansint=0


for i in range(n):
  if ans[i]==0:
    ansint+=1


print(ansint)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N, K = map(int, input().split())
list0 = [list(map(int, input().split())) for i in range(2*K)]
d = list0[0::2]
listd = list0[1::2]
listf = listd[0]
count = 0
for i in range(1, K):
  listf = listf + listd[i]

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

print(listf)
print(count)

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
if __name__ == '__main__':
    s = input()

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


if __name__ == '__main__':
    nk = input()
    nk = nk.split()
    n = int(nk[0])
    k = int(nk[1])

    d = []
    A = []

    for i in range(k):
        d_element = input()
        d_element = int(d_element)
        d.append(d_element)
        A_element = input()
        A_element = A_element.split()
        A_element = list(map(int,A_element))
        A.append(A_element)

    s = set()
    for i in range(len(A)):
        for j in range(len(A[i])):
            s.add(A[i][j])

    ans = n - len(s)
    print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
N,K=map(int,input().split())
hoge={}
for j in range(K):
    input()
    [hoge.update({int(j):1}) for j in input().split()]
print(sum([not j in hoge for j in range(N)]))


N,K=map(int,input().split())
hoge={}
for j in range(K):
    input()
    [hoge.update({int(j)-1:1}) for j in input().split()]
print(sum([not j in hoge for j in range(N)]))


Verdicts: Wrong Answer

Accepted
Problem: 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?

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

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


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


Verdicts: Runtime Error

Runtime Error

Accepted